Java Code Examples for com.sun.corba.se.impl.orbutil.ORBUtility

The following are top voted examples for showing how to use com.sun.corba.se.impl.orbutil.ORBUtility. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openjdk-jdk10   File: InterceptorInvoker.java   Source Code and License 6 votes vote down vote up
/**
 * Update the client delegate in the event of a ForwardRequest, given the
 * information in the passed-in info object.
 */
private void updateClientRequestDispatcherForward(
    ClientRequestInfoImpl info )
{
    ForwardRequest forwardRequest = info.getForwardRequestException();

    // ForwardRequest may be null if the forwarded IOR is set internal
    // to the ClientRequestDispatcher rather than explicitly through Portable
    // Interceptors.  In this case, we need not update the client
    // delegate ForwardRequest object.
    if( forwardRequest != null ) {
        org.omg.CORBA.Object object = forwardRequest.forward;

        // Convert the forward object into an IOR:
        IOR ior = ORBUtility.getIOR( object ) ;
        info.setLocatedIOR( ior );
    }
}
 
Example 2
Project: OpenJSharp   File: INSURLOperationImpl.java   Source Code and License 6 votes vote down vote up
/** This static method takes a Stringified IOR and converts it into IOR object.
  * It is the caller's responsibility to only pass strings that start with "IOR:".
  */
private org.omg.CORBA.Object getIORFromString( String str )
{
    // Length must be even for str to be valid
    if ( (str.length() & 1) == 1 )
        throw wrapper.badStringifiedIorLen() ;

    byte[] buf = new byte[(str.length() - ORBConstants.STRINGIFY_PREFIX.length()) / NIBBLES_PER_BYTE];
    for (int i=ORBConstants.STRINGIFY_PREFIX.length(), j=0; i < str.length(); i +=NIBBLES_PER_BYTE, j++) {
         buf[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << UN_SHIFT) & 0xF0);
         buf[j] |= (byte)(ORBUtility.hexOf(str.charAt(i+1)) & 0x0F);
    }
    EncapsInputStream s = EncapsInputStreamFactory.newEncapsInputStream(orb, buf, buf.length,
            orb.getORBData().getGIOPVersion());
    s.consumeEndian();
    return s.read_Object() ;
}
 
Example 3
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>deactivate_object</code>
 * <b>3.3.8.16</b>
 */
public void deactivate_object(byte[] id)
    throws ObjectNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling deactivate_object on poa " + this +
                " (id=" + id + ")" ) ;
        }

        mediator.deactivateObject( id ) ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting deactivate_object on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 4
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>create_reference</code>
 * <b>3.3.8.17</b>
 */
public org.omg.CORBA.Object create_reference(String repId)
    throws WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling create_reference(repId=" +
                repId + ") on poa " + this ) ;
        }

        return makeObject( repId, mediator.newSystemId()) ;
    } finally {
        unlock() ;
    }
}
 
Example 5
Project: OpenJSharp   File: CDROutputStream_1_0.java   Source Code and License 6 votes vote down vote up
public void write_Object(org.omg.CORBA.Object ref)
{
    if (ref == null) {
        IOR nullIOR = IORFactories.makeIOR( orb ) ;
        nullIOR.write(parent);
        return;
    }

    // IDL to Java formal 01-06-06 1.21.4.2
    if (ref instanceof org.omg.CORBA.LocalObject)
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);

    IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ;
    ior.write(parent);
    return;
}
 
Example 6
Project: openjdk-jdk10   File: CDROutputStream_1_0.java   Source Code and License 6 votes vote down vote up
public void write_wchar(char x)
{
    // Don't allow transmission of wchar/wstring data with
    // foreign ORBs since it's against the spec.
    if (ORBUtility.isForeignORB(orb)) {
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);
    }

    // If it's one of our legacy ORBs, do what they did:
    alignAndReserve(2, 2);

    if (littleEndian) {
        writeLittleEndianWchar(x);
    } else {
        writeBigEndianWchar(x);
    }
}
 
Example 7
Project: openjdk-jdk10   File: BootstrapResolverImpl.java   Source Code and License 6 votes vote down vote up
public BootstrapResolverImpl(ORB orb, String host, int port) {
    wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.ORB_RESOLVER ) ;

    // Create a new IOR with the magic of INIT
    byte[] initialKey = "INIT".getBytes() ;
    ObjectKey okey = orb.getObjectKeyFactory().create(initialKey) ;

    IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, host, port ) ;
    IIOPProfileTemplate ptemp = IIOPFactories.makeIIOPProfileTemplate(
        orb, GIOPVersion.V1_0, addr);

    IORTemplate iortemp = IORFactories.makeIORTemplate( okey.getTemplate() ) ;
    iortemp.add( ptemp ) ;

    IOR initialIOR = iortemp.makeIOR( (com.sun.corba.se.spi.orb.ORB)orb,
        "", okey.getId() ) ;

    bootstrapDelegate = ORBUtility.makeClientDelegate( initialIOR ) ;
}
 
Example 8
Project: OpenJSharp   File: StateEngineImpl.java   Source Code and License 6 votes vote down vote up
public void doIt( FSM fsm, Input in, boolean debug )
{
    // This method is present only for debugging.
    // innerDoIt does the actual transition.

    if (debug)
        ORBUtility.dprint( this, "doIt enter: currentState = " +
            fsm.getState() + " in = " + in ) ;

    try {
        innerDoIt( fsm, in, debug ) ;
    } finally {
        if (debug)
            ORBUtility.dprint( this, "doIt exit" ) ;
    }
}
 
Example 9
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
void etherealizeAll()
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling etheralizeAll on poa " + this ) ;
        }

        mediator.etherealizeAll() ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting etheralizeAll on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 10
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>the_activator</code>
 * <b>Section 3.3.8.9</b>
 */
public void the_activator(AdapterActivator activator)
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling the_activator on poa " +
                this + " activator=" + activator ) ;
        }

        this.activator = activator;
    } finally {
        unlock() ;
    }
}
 
Example 11
Project: openjdk-jdk10   File: ReentrantMutex.java   Source Code and License 6 votes vote down vote up
synchronized int releaseAll()
{
    try {
        if (debug)
            ORBUtility.dprintTrace( this, "releaseAll enter: " +
                " holder_=" + ORBUtility.getThreadName(holder_) +
                " counter_=" + counter_ ) ;

        Thread thr = Thread.currentThread();
        if (thr != holder_)
            throw new INTERNAL(
                "Attempt to releaseAll Mutex by thread not holding the Mutex" ) ;

        int result = counter_ ;
        counter_ = 0 ;
        holder_ = null ;
        notify() ;
        return result ;
    } finally {
        if (debug)
            ORBUtility.dprintTrace( this, "releaseAll exit: " +
                " holder_=" + ORBUtility.getThreadName(holder_) +
                " counter_=" + counter_ ) ;
    }
}
 
Example 12
Project: openjdk-jdk10   File: StateEngineImpl.java   Source Code and License 6 votes vote down vote up
public void doIt( FSM fsm, Input in, boolean debug )
{
    // This method is present only for debugging.
    // innerDoIt does the actual transition.

    if (debug)
        ORBUtility.dprint( this, "doIt enter: currentState = " +
            fsm.getState() + " in = " + in ) ;

    try {
        innerDoIt( fsm, in, debug ) ;
    } finally {
        if (debug)
            ORBUtility.dprint( this, "doIt exit" ) ;
    }
}
 
Example 13
Project: OpenJSharp   File: InterceptorInvoker.java   Source Code and License 6 votes vote down vote up
/**
 * Update the client delegate in the event of a ForwardRequest, given the
 * information in the passed-in info object.
 */
private void updateClientRequestDispatcherForward(
    ClientRequestInfoImpl info )
{
    ForwardRequest forwardRequest = info.getForwardRequestException();

    // ForwardRequest may be null if the forwarded IOR is set internal
    // to the ClientRequestDispatcher rather than explicitly through Portable
    // Interceptors.  In this case, we need not update the client
    // delegate ForwardRequest object.
    if( forwardRequest != null ) {
        org.omg.CORBA.Object object = forwardRequest.forward;

        // Convert the forward object into an IOR:
        IOR ior = ORBUtility.getIOR( object ) ;
        info.setLocatedIOR( ior );
    }
}
 
Example 14
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 15
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>reference_to_servant</code>
 * <b>3.3.8.21</b>
 */
public Servant reference_to_servant(org.omg.CORBA.Object reference)
    throws ObjectNotActive, WrongPolicy, WrongAdapter
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling reference_to_servant(reference=" +
                reference + ") on poa " + this ) ;
        }

        if ( state >= STATE_DESTROYING ) {
            throw lifecycleWrapper().adapterDestroyed() ;
        }

        // reference_to_id should throw WrongAdapter
        // if the objref was not created by this POA
        byte [] id = internalReferenceToId(reference);

        return mediator.idToServant( id ) ;
    } finally {
        unlock() ;
    }
}
 
Example 16
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>id_to_reference</code>
 * <b>3.3.8.24</b>
 */
public org.omg.CORBA.Object id_to_reference(byte[] id)
    throws ObjectNotActive, WrongPolicy

{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling id_to_reference(id=" +
                id + ") on poa " + this ) ;
        }

        if( state >= STATE_DESTROYING ) {
            throw lifecycleWrapper().adapterDestroyed() ;
        }

        Servant s = mediator.idToServant( id ) ;
        String repId = s._all_interfaces( this, id )[0] ;
        return makeObject(repId, id );
    } finally {
        unlock() ;
    }
}
 
Example 17
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
public void exit()
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling exit on poa " + this ) ;
        }

        invocationCount--;

        if ((invocationCount == 0) && (state == STATE_DESTROYING)) {
            invokeCV.broadcast();
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this, "Exiting exit on poa " + this ) ;
        }

        unlock() ;
    }

    manager.exit();
}
 
Example 18
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
private boolean waitUntilRunning()
{
    if (debug) {
        ORBUtility.dprint( this,
            "Calling waitUntilRunning on poa " + this ) ;
    }

    while (state < STATE_RUN) {
        try {
            adapterActivatorCV.await() ;
        } catch (InterruptedException exc) {
            // NO-OP
        }
    }

    if (debug) {
        ORBUtility.dprint( this,
            "Exiting waitUntilRunning on poa " + this ) ;
    }

    // Note that a POA could be destroyed while in STATE_INIT due to a
    // failure in the AdapterActivator upcall.
    return (state == STATE_RUN) ;
}
 
Example 19
Project: OpenJSharp   File: POAManagerImpl.java   Source Code and License 6 votes vote down vote up
synchronized void exit()
{
    try {
        if (debug) {
            ORBUtility.dprint( this,
                "Calling exit for POAManagerImpl " + this ) ;
        }

        nInvocations--;

        if ( nInvocations == 0 ) {
            // This notifies any threads that were in the
            // wait_for_completion loop in hold/discard/deactivate().
            notifyWaiters();
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting exit for POAManagerImpl " + this ) ;
        }
    }
}
 
Example 20
Project: OpenJSharp   File: TransientObjectManager.java   Source Code and License 6 votes vote down vote up
public synchronized java.lang.Object lookupServant(byte transientKey[])
{
    int index = ORBUtility.bytesToInt(transientKey,0);
    int counter = ORBUtility.bytesToInt(transientKey,4);

    if (orb.transientObjectManagerDebugFlag)
        dprint( "lookupServant called with index=" + index + ", counter=" + counter ) ;

    if (elementArray[index].counter == counter &&
        elementArray[index].valid ) {
        if (orb.transientObjectManagerDebugFlag)
            dprint( "\tcounter is valid" ) ;
        return elementArray[index].servant;
    }

    // servant not found
    if (orb.transientObjectManagerDebugFlag)
        dprint( "\tcounter is invalid" ) ;
    return null;
}
 
Example 21
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
public void doIt( POAImpl thePoa, boolean wait )
{
    if (debug) {
        ORBUtility.dprint( this,
            "Calling DestroyThread.doIt(thePOA=" + thePoa +
            " wait=" + wait + " etherealize=" + etherealize ) ;
    }

    this.thePoa = thePoa ;
    this.wait = wait ;

    if (wait) {
        run() ;
    } else {
        // Catch exceptions since setDaemon can cause a
        // security exception to be thrown under netscape
        // in the Applet mode
        try { setDaemon(true); } catch (Exception e) {}
        start() ;
    }
}
 
Example 22
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>the_activator</code>
 * <b>Section 3.3.8.9</b>
 */
public void the_activator(AdapterActivator activator)
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling the_activator on poa " +
                this + " activator=" + activator ) ;
        }

        this.activator = activator;
    } finally {
        unlock() ;
    }
}
 
Example 23
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>set_servant_manager</code>
 * <b>Section 3.3.8.10</b>
 */
public void set_servant_manager(ServantManager servantManager)
    throws WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling set_servant_manager on poa " +
                this + " servantManager=" + servantManager ) ;
        }

        mediator.setServantManager( servantManager ) ;
    } finally {
        unlock() ;
    }
}
 
Example 24
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example 25
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 5 votes vote down vote up
void lock()
{
    SyncUtil.acquire( poaMutex ) ;

    if (debug) {
        ORBUtility.dprint( this, "LOCKED poa " + this ) ;
    }
}
 
Example 26
Project: openjdk-jdk10   File: CorbaMessageMediatorImpl.java   Source Code and License 5 votes vote down vote up
public CorbaMessageMediatorImpl(ORB orb,
                                ContactInfo contactInfo,
                                Connection connection,
                                GIOPVersion giopVersion,
                                IOR ior,
                                int requestId,
                                short addrDisposition,
                                String operationName,
                                boolean isOneWay)
{
    this( orb, connection ) ;

    this.contactInfo = (CorbaContactInfo) contactInfo;
    this.addrDisposition = addrDisposition;

    streamFormatVersion =
        getStreamFormatVersionForThisRequest(
            ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(),
            giopVersion);
    streamFormatVersionSet = true;

    requestHeader = (RequestMessage) MessageBase.createRequest(
        this.orb,
        giopVersion,
        ORBUtility.getEncodingVersion(orb, ior),
        requestId,
        !isOneWay,
        ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(),
        this.addrDisposition,
        operationName,
        new ServiceContexts(orb),
        null);
}
 
Example 27
Project: openjdk-jdk10   File: CDROutputStream_1_0.java   Source Code and License 5 votes vote down vote up
private void writeArray(Serializable array, Class clazz) {

        if (valueHandler == null)
            valueHandler = ORBUtility.createValueHandler(); //d11638

        // Write value_tag
        int indirection = writeValueTag(mustChunk, true,
                                        Util.getCodebase(clazz));

        // Write repository ID
        write_repositoryId(repIdStrs.createSequenceRepID(clazz));

        // Add indirection for object to indirection table
        updateIndirectionTable(indirection, array, array);

        // Write Value chunk
        if (mustChunk) {
            start_block();
            end_flag--;
            chunkedValueNestingLevel--;
        } else
            end_flag--;

        if (valueHandler instanceof ValueHandlerMultiFormat) {
            ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler;
            vh.writeValue(parent, array, streamFormatVersion);
        } else
            valueHandler.writeValue(parent, array);

        if (mustChunk)
            end_block();

        // Write end tag
        writeEndTag(mustChunk);
    }
 
Example 28
Project: openjdk-jdk10   File: CDROutputStream_1_0.java   Source Code and License 5 votes vote down vote up
public void write_abstract_interface(java.lang.Object obj) {
    boolean corbaObject = false; // Assume value type.
    org.omg.CORBA.Object theObject = null;

    // Is it a CORBA.Object?

    if (obj != null && obj instanceof org.omg.CORBA.Object) {

        // Yes.

        theObject = (org.omg.CORBA.Object)obj;
        corbaObject = true;
    }

    // Write our flag...

    write_boolean(corbaObject);

    // Now write out the object...

    if (corbaObject) {
        write_Object(theObject);
    } else {
        try {
            write_value((java.io.Serializable)obj);
        } catch(ClassCastException cce) {
            if (obj instanceof java.io.Serializable)
                throw cce;
            else
                ORBUtility.throwNotSerializableForCorba(obj.getClass().getName());
        }
    }
}
 
Example 29
Project: OpenJSharp   File: INSServerRequestDispatcher.java   Source Code and License 5 votes vote down vote up
/**
 * getINSReference if it is registered in INSObjectKeyMap.
 */
private IOR getINSReference( String insKey ) {
    IOR entry = ORBUtility.getIOR( orb.getLocalResolver().resolve( insKey ) ) ;
    if( entry != null ) {
        // If entry is not null then the locate is with an INS Object key,
        // so send a location forward with the right IOR.
        return entry;
    }

    throw wrapper.servantNotFound() ;
}
 
Example 30
Project: openjdk-jdk10   File: CDROutputStream_1_0.java   Source Code and License 5 votes vote down vote up
public void write_wstring(String value)
{
    if (value == null)
        throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE);

    // Don't allow transmission of wchar/wstring data with
    // foreign ORBs since it's against the spec.
    if (ORBUtility.isForeignORB(orb)) {
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);
    }

    // When talking to our legacy ORBs, do what they did:
    int len = value.length() + 1;

    // This will only have an effect if we're already chunking
    handleSpecialChunkBegin(4 + (len * 2) + computeAlignment(4));

    write_long(len);

    for (int i = 0; i < len - 1; i++)
        write_wchar(value.charAt(i));

    // Write the null ending
    write_short((short)0);

    // This will only have an effect if we're already chunking
    handleSpecialChunkEnd();
}
 
Example 31
Project: openjdk-jdk10   File: RequestInfoImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Retrieves the IOR of the ForwardRequest exception.
 */
protected IOR getForwardRequestIOR() {
    if( this.forwardRequestIOR == null ) {
        if( this.forwardRequest != null ) {
            this.forwardRequestIOR = ORBUtility.getIOR(
                this.forwardRequest.forward ) ;
        }
    }

    return this.forwardRequestIOR;
}
 
Example 32
Project: OpenJSharp   File: ReplyMessage_1_0.java   Source Code and License 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }

    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example 33
Project: openjdk-jdk10   File: POAPolicyMediatorBase_R.java   Source Code and License 5 votes vote down vote up
public Servant deactivateObject( ActiveObjectMap.Key key )
    throws ObjectNotActive, WrongPolicy
{
    if (orb.poaDebugFlag) {
        ORBUtility.dprint( this,
            "Calling deactivateObject for key " + key ) ;
    }

    try {
        AOMEntry entry = activeObjectMap.get(key);
        if (entry == null)
            throw new ObjectNotActive();

        Servant s = activeObjectMap.getServant( entry ) ;
        if (s == null)
            throw new ObjectNotActive();

        if (orb.poaDebugFlag) {
            System.out.println("Deactivating object " + s + " with POA " + poa);
        }

        deactivateHelper( key, entry, s ) ;

        return s ;
    } finally {
        if (orb.poaDebugFlag) {
            ORBUtility.dprint( this,
                "Exiting deactivateObject" ) ;
        }
    }
}
 
Example 34
Project: OpenJSharp   File: ReplyMessage_1_1.java   Source Code and License 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }
    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR(cdr) ;
    }
}
 
Example 35
Project: OpenJSharp   File: ReentrantMutex.java   Source Code and License 5 votes vote down vote up
public void acquire() throws InterruptedException {
    if (Thread.interrupted())
        throw new InterruptedException();

    synchronized(this) {
        try {
            if (debug)
                ORBUtility.dprintTrace( this,
                    "acquire enter: holder_=" +
                    ORBUtility.getThreadName(holder_) +
                    " counter_=" + counter_ ) ;

            Thread thr = Thread.currentThread();
            if (holder_ != thr) {
                try {
                    while (counter_ > 0)
                        wait();

                    // This can't happen, but make sure anyway
                    if (counter_ != 0)
                        throw new INTERNAL(
                            "counter not 0 when first acquiring mutex" ) ;

                    holder_ = thr;
                } catch (InterruptedException ex) {
                    notify();
                    throw ex;
                }
            }

            counter_ ++ ;
        } finally {
            if (debug)
                ORBUtility.dprintTrace( this, "acquire exit: holder_=" +
                ORBUtility.getThreadName(holder_) + " counter_=" +
                counter_ ) ;
        }
    }
}
 
Example 36
Project: openjdk-jdk10   File: ReplyMessage_1_0.java   Source Code and License 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }

    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example 37
Project: openjdk-jdk10   File: ForwardException.java   Source Code and License 5 votes vote down vote up
public synchronized IOR getIOR()
{
    if (ior == null) {
        ior = ORBUtility.getIOR( obj ) ;
    }

    return ior ;
}
 
Example 38
Project: OpenJSharp   File: POAImpl.java   Source Code and License 5 votes vote down vote up
private boolean destroyIfNotInitDone()
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling destroyIfNotInitDone on poa " + this ) ;
        }

        boolean success = (state == STATE_INIT_DONE) ;

        if (success)
            state = STATE_RUN ;
        else {
            // Don't just use destroy, because the check for
            // deadlock is too general, and can prevent this from
            // functioning properly.
            DestroyThread destroyer = new DestroyThread( false, debug );
            destroyer.doIt( this, true ) ;
        }

        return success ;
    } finally {
        adapterActivatorCV.broadcast() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Exiting destroyIfNotInitDone on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 39
Project: openjdk-jdk10   File: ForwardException.java   Source Code and License 5 votes vote down vote up
public synchronized org.omg.CORBA.Object getObject()
{
    if (obj == null) {
        obj = ORBUtility.makeObjectReference( ior ) ;
    }

    return obj ;
}
 
Example 40
Project: OpenJSharp   File: POAImpl.java   Source Code and License 5 votes vote down vote up
/**
 * <code>activate_object</code>
 * <b>Section 3.3.8.14</b>
 */
public byte[] activate_object(Servant servant)
    throws ServantAlreadyActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling activate_object on poa " + this +
                " (servant=" + servant + ")" ) ;
        }

        // Allocate a new system-generated object-id.
        // This will throw WrongPolicy if not SYSTEM_ID
        // policy.
        byte[] id = mediator.newSystemId();

        try {
            mediator.activateObject( id, servant ) ;
        } catch (ObjectAlreadyActive oaa) {
            // This exception can not occur in this case,
            // since id is always brand new.
            //
        }

        return id ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting activate_object on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 41
Project: OpenJSharp   File: POAImpl.java   Source Code and License 5 votes vote down vote up
/**
 * <code>activate_object_with_id</code>
 * <b>Section 3.3.8.15</b>
 */
public void activate_object_with_id(byte[] id,
                                                 Servant servant)
    throws ObjectAlreadyActive, ServantAlreadyActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling activate_object_with_id on poa " + this +
                " (servant=" + servant + " id=" + id + ")" ) ;
        }

        // Clone the id to avoid possible errors due to aliasing
        // (e.g. the client passes the id in and then changes it later).
        byte[] idClone = (byte[])(id.clone()) ;

        mediator.activateObject( idClone, servant ) ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting activate_object_with_id on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 42
Project: openjdk-jdk10   File: POAManagerImpl.java   Source Code and License 5 votes vote down vote up
/**
 * <code>hold_requests</code>
 * <b>Spec: pages 3-14 thru 3-18</b>
 */
public synchronized void hold_requests(boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    explicitStateChange = true ;

    if (debug) {
        ORBUtility.dprint( this,
            "Calling hold_requests on POAManager " + this ) ;
    }

    try {
        if ( state.value() == State._INACTIVE )
            throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();
        // set the state to HOLDING
        state  = State.HOLDING;

        pihandler.adapterManagerStateChanged( myId, getORTState() ) ;

        // Notify any threads that were waiting in the wait() inside
        // discard_requests. This will cause discard_requests to return
        // (which is in conformance with the spec).
        notifyWaiters();

        if ( wait_for_completion ) {
            while ( state.value() == State._HOLDING && nInvocations > 0 ) {
                countedWait() ;
            }
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting hold_requests on POAManager " + this ) ;
        }
    }
}
 
Example 43
Project: OpenJSharp   File: RequestInfoImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Retrieves the IOR of the ForwardRequest exception.
 */
protected IOR getForwardRequestIOR() {
    if( this.forwardRequestIOR == null ) {
        if( this.forwardRequest != null ) {
            this.forwardRequestIOR = ORBUtility.getIOR(
                this.forwardRequest.forward ) ;
        }
    }

    return this.forwardRequestIOR;
}
 
Example 44
Project: OpenJSharp   File: POAImpl.java   Source Code and License 5 votes vote down vote up
public void enter() throws OADestroyed
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling enter on poa " + this ) ;
        }

        // Avoid deadlock if this is the thread that is processing the
        // POA.destroy because this is the only thread that can notify
        // waiters on beingDestroyedCV.  This can happen if an
        // etherealize upcall invokes a method on a colocated object
        // served by this POA.
        while ((state == STATE_DESTROYING) &&
            (isDestroying.get() == Boolean.FALSE)) {
            try {
                beingDestroyedCV.await();
            } catch (InterruptedException ex) {
                // NO-OP
            }
        }

        if (!waitUntilRunning())
            throw new OADestroyed() ;

        invocationCount++;
    } finally {
        if (debug) {
            ORBUtility.dprint( this, "Exiting enter on poa " + this ) ;
        }

        unlock() ;
    }

    manager.enter();
}
 
Example 45
Project: OpenJSharp   File: CDRInputStream_1_0.java   Source Code and License 5 votes vote down vote up
public String read_wstring() {
    // Don't allow transmission of wchar/wstring data with
    // foreign ORBs since it's against the spec.
    if (ORBUtility.isForeignORB((ORB)orb)) {
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);
    }

    int len = read_long();

    //
    // Workaround for ORBs which send string lengths of
    // zero to mean empty string.
    //
    //
    // IMPORTANT: Do not replace 'new String("")' with "", it may result
    // in a Serialization bug (See serialization.zerolengthstring) and
    // bug id: 4728756 for details
    if (len == 0)
        return new String("");

    checkForNegativeLength(len);

    len--;
    char[] c = new char[len];

    for (int i = 0; i < len; i++)
        c[i] = read_wchar();

    // skip the two null terminator bytes
    read_wchar();
    // bbwi.position(bbwi.position() + 2);

    return new String(c);
}
 
Example 46
Project: openjdk-jdk10   File: ReplyMessage_1_1.java   Source Code and License 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }
    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR(cdr) ;
    }
}
 
Example 47
Project: OpenJSharp   File: POAPolicyMediatorImpl_R_USM.java   Source Code and License 5 votes vote down vote up
public void run() {
    if (debug) {
        ORBUtility.dprint( this, "Calling Etherealizer.run on key " +
            key ) ;
    }

    try {
        try {
            mediator.activator.etherealize( key.id, mediator.poa, servant,
                false, mediator.activeObjectMap.hasMultipleIDs( entry ) );
        } catch (Exception exc) {
            // ignore all exceptions
        }

        try {
            mediator.poa.lock() ;

            entry.etherealizeComplete() ;
            mediator.activeObjectMap.remove( key ) ;

            POAManagerImpl pm = (POAManagerImpl)mediator.poa.the_POAManager() ;
            POAFactory factory = pm.getFactory() ;
            factory.unregisterPOAForServant( mediator.poa, servant);
        } finally {
            mediator.poa.unlock() ;
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this, "Exiting Etherealizer.run" ) ;
        }
    }
}
 
Example 48
Project: OpenJSharp   File: POAManagerImpl.java   Source Code and License 5 votes vote down vote up
private void notifyWaiters()
{
    if (debug) {
        ORBUtility.dprint( this, "Calling notifyWaiters on POAManager " +
            this + " nWaiters=" + nWaiters ) ;
    }

    if (nWaiters >0)
        notifyAll() ;
}
 
Example 49
Project: openjdk-jdk10   File: TransientObjectManager.java   Source Code and License 5 votes vote down vote up
public synchronized void deleteServant(byte transientKey[])
{
    int index = ORBUtility.bytesToInt(transientKey,0);
    if (orb.transientObjectManagerDebugFlag)
        dprint( "deleting servant at index=" + index ) ;

    elementArray[index].delete(freeList);
    freeList = elementArray[index];
}
 
Example 50
Project: OpenJSharp   File: POAManagerImpl.java   Source Code and License 5 votes vote down vote up
/**
 * <code>hold_requests</code>
 * <b>Spec: pages 3-14 thru 3-18</b>
 */
public synchronized void hold_requests(boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    explicitStateChange = true ;

    if (debug) {
        ORBUtility.dprint( this,
            "Calling hold_requests on POAManager " + this ) ;
    }

    try {
        if ( state.value() == State._INACTIVE )
            throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();
        // set the state to HOLDING
        state  = State.HOLDING;

        pihandler.adapterManagerStateChanged( myId, getORTState() ) ;

        // Notify any threads that were waiting in the wait() inside
        // discard_requests. This will cause discard_requests to return
        // (which is in conformance with the spec).
        notifyWaiters();

        if ( wait_for_completion ) {
            while ( state.value() == State._HOLDING && nInvocations > 0 ) {
                countedWait() ;
            }
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting hold_requests on POAManager " + this ) ;
        }
    }
}
 
Example 51
Project: OpenJSharp   File: POAManagerImpl.java   Source Code and License 5 votes vote down vote up
/**
 * <code>discard_requests</code>
 * <b>Spec: pages 3-14 thru 3-18</b>
 */
public synchronized void discard_requests(boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    explicitStateChange = true ;

    if (debug) {
        ORBUtility.dprint( this,
            "Calling hold_requests on POAManager " + this ) ;
    }

    try {
        if ( state.value() == State._INACTIVE )
            throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();

        // set the state to DISCARDING
        state = State.DISCARDING;

        pihandler.adapterManagerStateChanged( myId, getORTState() ) ;

        // Notify any invocations that were waiting because the previous
        // state was HOLDING. Those invocations will henceforth be rejected with
        // a TRANSIENT exception. Also notify any threads that were waiting
        // inside hold_requests().
        notifyWaiters();

        if ( wait_for_completion ) {
            while ( state.value() == State._DISCARDING && nInvocations > 0 ) {
                countedWait() ;
            }
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting hold_requests on POAManager " + this ) ;
        }
    }
}
 
Example 52
Project: openjdk-jdk10   File: POAManagerImpl.java   Source Code and License 5 votes vote down vote up
private void notifyWaiters()
{
    if (debug) {
        ORBUtility.dprint( this, "Calling notifyWaiters on POAManager " +
            this + " nWaiters=" + nWaiters ) ;
    }

    if (nWaiters >0)
        notifyAll() ;
}
 
Example 53
Project: openjdk-jdk10   File: POAPolicyMediatorImpl_R_USM.java   Source Code and License 5 votes vote down vote up
public void run() {
    if (debug) {
        ORBUtility.dprint( this, "Calling Etherealizer.run on key " +
            key ) ;
    }

    try {
        try {
            mediator.activator.etherealize( key.id, mediator.poa, servant,
                false, mediator.activeObjectMap.hasMultipleIDs( entry ) );
        } catch (Exception exc) {
            // ignore all exceptions
        }

        try {
            mediator.poa.lock() ;

            entry.etherealizeComplete() ;
            mediator.activeObjectMap.remove( key ) ;

            POAManagerImpl pm = (POAManagerImpl)mediator.poa.the_POAManager() ;
            POAFactory factory = pm.getFactory() ;
            factory.unregisterPOAForServant( mediator.poa, servant);
        } finally {
            mediator.poa.unlock() ;
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this, "Exiting Etherealizer.run" ) ;
        }
    }
}
 
Example 54
Project: openjdk-jdk10   File: Util.java   Source Code and License 5 votes vote down vote up
/**
 * Writes any java.lang.Object as a CORBA any.
 * @param out the stream in which to write the any.
 * @param obj the object to write as an any.
 */
public void writeAny( org.omg.CORBA.portable.OutputStream out,
                     java.lang.Object obj)
{
    org.omg.CORBA.ORB orb = out.orb();

    // Create Any
    Any any = orb.create_any();

    // Make sure we have a connected object...
    java.lang.Object newObj = Utility.autoConnect(obj,orb,false);

    if (newObj instanceof org.omg.CORBA.Object) {
        any.insert_Object((org.omg.CORBA.Object)newObj);
    } else {
        if (newObj == null) {
            // Handle the null case, including backwards
            // compatibility issues
            any.insert_Value(null, createTypeCodeForNull(orb));
        } else {
            if (newObj instanceof Serializable) {
                // If they're our Any and ORB implementations,
                // we may want to do type code related versioning.
                TypeCode tc = createTypeCode((Serializable)newObj, any, orb);
                if (tc == null)
                    any.insert_Value((Serializable)newObj);
                else
                    any.insert_Value((Serializable)newObj, tc);
            } else if (newObj instanceof Remote) {
                ORBUtility.throwNotSerializableForCorba(newObj.getClass().getName());
            } else {
                ORBUtility.throwNotSerializableForCorba(newObj.getClass().getName());
            }
        }
    }

    out.write_any(any);
}
 
Example 55
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 5 votes vote down vote up
private boolean destroyIfNotInitDone()
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling destroyIfNotInitDone on poa " + this ) ;
        }

        boolean success = (state == STATE_INIT_DONE) ;

        if (success)
            state = STATE_RUN ;
        else {
            // Don't just use destroy, because the check for
            // deadlock is too general, and can prevent this from
            // functioning properly.
            DestroyThread destroyer = new DestroyThread( false, debug );
            destroyer.doIt( this, true ) ;
        }

        return success ;
    } finally {
        adapterActivatorCV.broadcast() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Exiting destroyIfNotInitDone on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 56
Project: OpenJSharp   File: CDROutputStream_1_0.java   Source Code and License 5 votes vote down vote up
public void write_wstring(String value)
{
    if (value == null)
        throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE);

    // Don't allow transmission of wchar/wstring data with
    // foreign ORBs since it's against the spec.
    if (ORBUtility.isForeignORB(orb)) {
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);
    }

    // When talking to our legacy ORBs, do what they did:
    int len = value.length() + 1;

    // This will only have an effect if we're already chunking
    handleSpecialChunkBegin(4 + (len * 2) + computeAlignment(4));

    write_long(len);

    for (int i = 0; i < len - 1; i++)
        write_wchar(value.charAt(i));

    // Write the null ending
    write_short((short)0);

    // This will only have an effect if we're already chunking
    handleSpecialChunkEnd();
}
 
Example 57
Project: openjdk-jdk10   File: IDLJavaSerializationOutputStream.java   Source Code and License 5 votes vote down vote up
public final void write_abstract_interface(java.lang.Object obj) {

        boolean isCorbaObject = false; // Assume value type.
        org.omg.CORBA.Object theCorbaObject = null;

        // Is it a CORBA.Object?
        if (obj != null && obj instanceof org.omg.CORBA.Object) {
            theCorbaObject = (org.omg.CORBA.Object)obj;
            isCorbaObject = true;
        }

        // Write the boolean flag.
        this.write_boolean(isCorbaObject);

        // Now write out the object.
        if (isCorbaObject) {
            write_Object(theCorbaObject);
        } else {
            try {
                write_value((java.io.Serializable)obj);
            } catch(ClassCastException cce) {
                if (obj instanceof java.io.Serializable) {
                    throw cce;
                } else {
                    ORBUtility.throwNotSerializableForCorba(
                                                    obj.getClass().getName());
                }
            }
        }
    }
 
Example 58
Project: openjdk-jdk10   File: POAManagerImpl.java   Source Code and License 4 votes vote down vote up
/**
 * <code>deactivate</code>
 * <b>Spec: pages 3-14 thru 3-18</b>
 * Note: INACTIVE is a permanent state.
 */

public void deactivate(boolean etherealize_objects, boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    explicitStateChange = true ;

    try {
        synchronized( this ) {
            if (debug) {
                ORBUtility.dprint( this,
                    "Calling deactivate on POAManager " + this ) ;
            }

            if ( state.value() == State._INACTIVE )
                throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();

            state = State.INACTIVE;

            pihandler.adapterManagerStateChanged( myId, getORTState() ) ;

            // Notify any invocations that were waiting because the previous
            // state was HOLDING. Those invocations will then be rejected with
            // an OBJ_ADAPTER exception. Also notify any threads that were waiting
            // inside hold_requests() or discard_requests().
            notifyWaiters();
        }

        POAManagerDeactivator deactivator = new POAManagerDeactivator( this,
            etherealize_objects, debug ) ;

        if (wait_for_completion)
            deactivator.run() ;
        else {
            Thread thr = new Thread(null, deactivator, "POA-Deactivator-Thread", 0, false) ;
            thr.start() ;
        }
    } finally {
        synchronized(this) {
            if (debug) {
                ORBUtility.dprint( this,
                    "Exiting deactivate on POAManager " + this ) ;
            }
        }
    }
}
 
Example 59
Project: OpenJSharp   File: ServiceContextRegistry.java   Source Code and License 4 votes vote down vote up
private void dprint( String msg )
{
    ORBUtility.dprint( this, msg ) ;
}
 
Example 60
Project: OpenJSharp   File: ServiceContext.java   Source Code and License 4 votes vote down vote up
private void dprint( String msg )
{
    ORBUtility.dprint( this, msg ) ;
}