poaorb.java

来自「java jdk 1.4的源码」· Java 代码 · 共 988 行 · 第 1/3 页

JAVA
988
字号
                sc.setOrb(this);                sc.setId(scid);                subcontractRegistry.registerServer(sc, scid);            } catch (Exception exc) {                if (subcontractDebugFlag)                    exc.printStackTrace();	    }        }    }    // Hook to enable the subclassed ORBs to initialize their services    // after POA creation    protected void initServices()    {    }    // Hook to enable the subclassed ORBs to put additional service    // contexts while building a reply    protected void getServiceSpecificServiceContexts(int scid,                                                        ServerRequest serverRequest,                                                        ServiceContexts contexts)    {    }    public GenericPOAServerSC getServerSubcontract(POAImpl poa)     {        // here return the GenericPOAServerSC, and it takes care of handling        // non-transactional cases	Policies policies = poa.getPolicies();	ServerSubcontract subcontract;        if ( !policies.isPersistent() )            subcontract = subcontractRegistry.getServerSubcontract(		ORBConstants.TransientSCID);        else            subcontract = subcontractRegistry.getServerSubcontract(		ORBConstants.PersistentSCID);	return (GenericPOAServerSC) subcontract;    }    protected IOR objectReferenceCreated( IOR ior )     {	return ior ;    }    public boolean isLocalServerId( int subcontractId, int serverId )    {	if ((subcontractId < ORBConstants.FIRST_POA_SCID) || 	    (subcontractId > ORBConstants.MAX_POA_SCID))	    return super.isLocalServerId( subcontractId, serverId ) ;			if (GenericPOAServerSC.isTransient( subcontractId ))	    return (serverId == getTransientServerId()) ;	else if (persistentServerIdInitialized)	    return (serverId == getPersistentServerId()) ;	else	    return false ;    }    //==============================================================================    // In support of the Servant to be implemented by org.omg.CORBA_2_3.ORB s.    //==============================================================================    public void set_delegate(java.lang.Object servant){        checkShutdownState();        ((org.omg.PortableServer.Servant)servant)            ._set_delegate(new DelegateImpl(this));    }    /**************************************************************************     *     *  The following method is a hook for Portable IOR Interceptors     *     *************************************************************************/    /**     * Called when a new POA is created.  This hook is empty in POAORB,      * but will be filled in in PIORB.  This allows us to ship both with and     * without Portable Interceptor support without need to change any code.     *     * @param poaImpl The POAImpl associated with the interceptors to be     *   invoked.     */    protected void invokeIORInterceptors( POAImpl poaImpl ) {    }    /*     **************************************************************************     *  The following methods are hooks for Portable Interceptors.     *  They have empty method bodies so that we may ship with or without     *  PI support.  The actual implementations can be found in      *  Interceptors.PIORB.  The uppermost implementations can be found     *  in corba.ORB.  Some are explicitly overridden here in protected      *  scope so that we can access them from the classes in the POA package.     *************************************************************************/    /*     *****************     * Client PI hooks     *****************/        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void disableInterceptorsThisThread() {        super.disableInterceptorsThisThread();    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void enableInterceptorsThisThread() {        super.enableInterceptorsThisThread();    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void invokeClientPIStartingPoint()         throws RemarshalException     {        super.invokeClientPIStartingPoint();    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected Exception invokeClientPIEndingPoint(        int replyStatus, Exception exception )    {        return super.invokeClientPIEndingPoint( replyStatus, exception );    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void initiateClientPIRequest( boolean diiRequest ) {        super.initiateClientPIRequest( diiRequest );    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void cleanupClientPIRequest() {        super.cleanupClientPIRequest();    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setClientPIInfo( Connection connection,				    ClientDelegate delegate,                                     IOR effectiveTarget,                                    IIOPProfile profile,                                     int requestId,                                    String opName,                                    boolean isOneWay,                                    ServiceContexts svc )     {        super.setClientPIInfo( connection, delegate, effectiveTarget, profile,                                requestId, opName, isOneWay, svc );    }    /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setClientPIInfo( ClientResponse response ) {        super.setClientPIInfo( response );    }    /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setClientPIInfo( RequestImpl requestImpl ) {        super.setClientPIInfo( requestImpl );    }    /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void sendCancelRequestIfFinalFragmentNotSent() {        super.sendCancelRequestIfFinalFragmentNotSent();    }        /*     *****************     * Server PI hooks     *****************/        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void invokeServerPIStartingPoint()         throws InternalRuntimeForwardRequest    {        super.invokeServerPIStartingPoint();    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void invokeServerPIIntermediatePoint()         throws InternalRuntimeForwardRequest    {        super.invokeServerPIIntermediatePoint();    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void invokeServerPIEndingPoint( ReplyMessage replyMessage )        throws InternalRuntimeForwardRequest    {        super.invokeServerPIEndingPoint( replyMessage );    }       /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void initializeServerPIInfo( ServerRequest request,	java.lang.Object poaimpl, byte[] objectId, byte[] adapterId )     {	super.initializeServerPIInfo( request, poaimpl, objectId, adapterId );    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setServerPIInfo( java.lang.Object servant, 				    String targetMostDerivedInterface )     {        super.setServerPIInfo( servant, targetMostDerivedInterface );    }        /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setServerPIInfo( Exception exception ) {        super.setServerPIInfo( exception );    }    /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setServerPIInfo( NVList arguments ) {        super.setServerPIInfo( arguments );    }    /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setServerPIExceptionInfo( Any exception ) {        super.setServerPIExceptionInfo( exception );    }    /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void setServerPIInfo( Any result ) {        super.setServerPIInfo( result );    }    /**     * Overridden from corba.ORB.     * See description in corba.ORB.     */    protected void cleanupServerPIRequest() {	super.cleanupServerPIRequest();    }    /*     **************************************************************************     * End Portable Interceptors Hooks     *************************************************************************/    // Check if the target objref has non-transactional SCID even though    // servant is transactional. If so, throw return new IOR to be forwarded.    public IOR checkTransactional( Servant servant, byte[] oid,	POAImpl poa, int targetScid )     {	return null ;    }    // Hook for client subcontract to obtain Tx service context    // for sending request    public ServiceContext getTxServiceContext( int RequestId )     {	return null ;    }    // Hook for client subcontract to handle Tx service context    // in received reply    public void handleTxServiceContext( ServiceContexts scs,	Exception exception, int requestId ) throws WrongTransaction    {	// NO-OP here    }    public void dump( String type )    {	if (type.equals( "serverSubcontract" ) )	    subcontractRegistry.dumpServers() ;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?