📄 objectimpl.java
字号:
Class[] argc = { org.omg.CORBA.Object.class }; java.lang.reflect.Method meth = delegate.getClass().getMethod("get_interface", argc); Object[] argx = { this }; return (org.omg.CORBA.Object)meth.invoke(delegate, argx); } catch( java.lang.reflect.InvocationTargetException exs ) { Throwable t = exs.getTargetException(); if (t instanceof Error) { throw (Error) t; } else if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new org.omg.CORBA.NO_IMPLEMENT(); } } catch( RuntimeException rex ) { throw rex; } catch( Exception exr ) { throw new org.omg.CORBA.NO_IMPLEMENT(); } } } /** * Returns a reference to the ORB associated with this object and * its delegate. This is the <code>ORB</code> object that created * the delegate. * * @return the <code>ORB</code> instance that created the * <code>Delegate</code> object contained in this * <code>ObjectImpl</code> object */ public org.omg.CORBA.ORB _orb() { return _get_delegate().orb(this); } /** * Retrieves the <code>Policy</code> object for this * <code>ObjectImpl</code> object that has the given * policy type. * * @param policy_type an int indicating the policy type * @return the <code>Policy</code> object that is the specified policy type * and that applies to this <code>ObjectImpl</code> object * @see org.omg.CORBA.PolicyOperations#policy_type */ public org.omg.CORBA.Policy _get_policy(int policy_type) { return _get_delegate().get_policy(this, policy_type); } /** * Retrieves a list of the domain managers for this * <code>ObjectImpl</code> object. * * @return an array containing the <code>DomainManager</code> * objects for this instance of <code>ObjectImpl</code> */ public org.omg.CORBA.DomainManager[] _get_domain_managers() { return _get_delegate().get_domain_managers(this); } /** * Sets this <code>ObjectImpl</code> object's override type for * the given policies to the given instance of * <code>SetOverrideType</code>. * * @param policies an array of <code>Policy</code> objects with the * policies that will replace the current policies or be * added to the current policies * @param set_add either <code>SetOverrideType.SET_OVERRIDE</code>, * indicating that the given policies will replace any existing * ones, or <code>SetOverrideType.ADD_OVERRIDE</code>, indicating * that the given policies should be added to any existing ones * @return an <code>Object</code> with the given policies replacing or * added to its previous policies */ public org.omg.CORBA.Object _set_policy_override(org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add) { return _get_delegate().set_policy_override(this, policies, set_add); } /** * Checks whether this <code>ObjectImpl</code> object is implemented * by a local servant. If so, local invocation API's may be used. * * @return <code>true</code> if this object is implemented by a local * servant; <code>false</code> otherwise */ public boolean _is_local() { return _get_delegate().is_local(this); } /** * Returns a Java reference to the local servant that should be used for sending * a request for the method specified. If this <code>ObjectImpl</code> * object is a local stub, it will invoke the <code>_servant_preinvoke</code> * method before sending a request in order to obtain the * <code>ServantObject</code> instance to use. * <P> * If a <code>ServantObject</code> object is returned, its <code>servant</code> * field has been set to an object of the expected type (Note: the object may * or may not be the actual servant instance). The local stub may cast * the servant field to the expected type, and then invoke the operation * directly. The <code>ServantRequest</code> object is valid for only one * invocation and cannot be used for more than one invocation. * * @param operation a <code>String</code> containing the name of the method * to be invoked. This name should correspond to the method name as * it would be encoded in a GIOP request. * * @param expectedType a <code>Class</code> object representing the * expected type of the servant that is returned. This expected * type is the <code>Class</code> object associated with the * operations class for the stub's interface. For example, a * stub for an interface <code>Foo</code> would pass the * <code>Class</code> object for the <code>FooOperations</code> * interface. * * @return (1) a <code>ServantObject</code> object, which may or may * not be the actual servant instance, or (2) <code>null</code> if * (a) the servant is not local or (b) the servant has ceased to * be local due to a ForwardRequest from a POA ServantManager * @throws org.omg.CORBA.BAD_PARAM if the servant is not the expected type */ public ServantObject _servant_preinvoke(String operation, Class expectedType) { return _get_delegate().servant_preinvoke(this, operation, expectedType); } /** * Is called by the local stub after it has invoked an operation * on the local servant that was previously retrieved from a * call to the method <code>_servant_preinvoke</code>. * The <code>_servant_postinvoke</code> method must be called * if the <code>_servant_preinvoke</code> * method returned a non-null value, even if an exception was thrown * by the method invoked by the servant. For this reason, the call * to the method <code>_servant_postinvoke</code> should be placed * in a Java <code>finally</code> clause. * * @param servant the instance of the <code>ServantObject</code> * returned by the <code>_servant_preinvoke</code> method */ public void _servant_postinvoke(ServantObject servant) { _get_delegate().servant_postinvoke(this, servant); } /* * The following methods were added by orbos/98-04-03: Java to IDL * Mapping. These are used by RMI over IIOP. */ /** * Returns an <code>OutputStream</code> object to use for marshalling * the arguments of the given method. This method is called by a stub, * which must indicate if a response is expected, that is, whether or not * the call is oneway. * * @param operation a String giving the name of the method. * @param responseExpected a boolean -- <code>true</code> if the * request is not one way, that is, a response is expected * @return an <code>OutputStream</code> object for dispatching the request */ public OutputStream _request(String operation, boolean responseExpected) { return _get_delegate().request(this, operation, responseExpected); } /** * Invokes an operation and returns an <code>InputStream</code> * object for reading the response. The stub provides the * <code>OutputStream</code> object that was previously returned by a * call to the <code>_request</code> method. The method specified * as an argument to <code>_request</code> when it was * called previously is the method that this method invokes. * <P> * If an exception occurs, the <code>_invoke</code> method may throw an * <code>ApplicationException</code> object that contains an InputStream from * which the user exception state may be unmarshalled. * * @param output an OutputStream object for dispatching the request * @return an <code>InputStream</code> object containing the marshalled * response to the method invoked * @throws ApplicationException if the invocation * meets application-defined exception * @throws RemarshalException if the invocation leads * to a remarshalling error * @see #_request */ public InputStream _invoke(OutputStream output) throws ApplicationException, RemarshalException { return _get_delegate().invoke(this, output); } /** * Releases the given * reply stream back to the ORB when unmarshalling has * completed after a call to the method <code>_invoke</code>. * Calling this method is optional for the stub. * * @param input the <code>InputStream</code> object that was returned * by the <code>_invoke</code> method or the * <code>ApplicationException.getInputStream</code> method; * may be <code>null</code>, in which case this method does * nothing * @see #_invoke */ public void _releaseReply(InputStream input) { _get_delegate().releaseReply(this, input); } /** * Returns a <code>String</code> object that represents this * <code>ObjectImpl</code> object. * * @return the <code>String</code> representation of this object */ public String toString() { if ( __delegate != null ) return __delegate.toString(this); else return getClass().getName() + ": no delegate set"; } /** * Returns the hash code for this <code>ObjectImpl</code> object. * * @return the hash code for this object */ public int hashCode() { if ( __delegate != null ) return __delegate.hashCode(this); else return super.hashCode(); } /** * Compares this <code>ObjectImpl</code> object with the given one * for equality. * *@param obj the object with which to compare this object *@return <code>true</code> if the two objects are equal; * <code>false</code> otherwise */ public boolean equals(java.lang.Object obj) { if ( __delegate != null ) return __delegate.equals(this, obj); else return (this==obj); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -