Java Code Examples for com.sun.corba.se.pept.encoding.InputObject

The following examples show how to use com.sun.corba.se.pept.encoding.InputObject. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void endRequest(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB) messageMediator.getBroker();
    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest<-: " + opAndId(messageMediator));
    }

    // release NIO ByteBuffers to ByteBufferPool

    try {
        OutputObject outputObj = messageMediator.getOutputObject();
        if (outputObj != null) {
            outputObj.close();
        }
        InputObject inputObj = messageMediator.getInputObject();
        if (inputObj != null) {
            inputObj.close();
        }
    } catch (IOException ex) {
        // Given what close() does, this catch shouldn't ever happen.
        // See CDRInput/OutputObject.close() for more info.
        // It also won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest: IOException:" + ex.getMessage(), ex);
        }
    } finally {
        ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds();
    }
}
 
Example #2
Source Project: openjdk-8   Author: bpupadhyaya   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void signalResponseReceived()
{
    // This will end up using the MessageMediator associated with
    // the original request instead of the current mediator (which
    // need to be constructed to hold the dispatchBuffer and connection).
    connection.getResponseWaitingRoom()
        .responseReceived((InputObject)inputObject);
}
 
Example #3
Source Project: hottub   Author: dsrg-uoft   File: SocketOrChannelAcceptorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #4
Source Project: openjdk-8   Author: bpupadhyaya   File: CorbaClientDelegateImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #5
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject waitForResponse()
{
    if (getRequestHeader().isResponseExpected()) {
        return connection.waitForResponse(this);
    }
    return null;
}
 
Example #6
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CorbaMessageMediatorImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void signalResponseReceived()
{
    // This will end up using the MessageMediator associated with
    // the original request instead of the current mediator (which
    // need to be constructed to hold the dispatchBuffer and connection).
    connection.getResponseWaitingRoom()
        .responseReceived((InputObject)inputObject);
}
 
Example #7
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CorbaMessageMediatorImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void endRequest(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB) messageMediator.getBroker();
    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest<-: " + opAndId(messageMediator));
    }

    // release NIO ByteBuffers to ByteBufferPool

    try {
        OutputObject outputObj = messageMediator.getOutputObject();
        if (outputObj != null) {
            outputObj.close();
        }
        InputObject inputObj = messageMediator.getInputObject();
        if (inputObj != null) {
            inputObj.close();
        }
    } catch (IOException ex) {
        // Given what close() does, this catch shouldn't ever happen.
        // See CDRInput/OutputObject.close() for more info.
        // It also won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest: IOException:" + ex.getMessage(), ex);
        }
    } finally {
        ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds();
    }
}
 
Example #8
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CorbaContactInfoBase.java    License: Apache License 2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #9
Source Project: openjdk-8-source   Author: keerath   File: CorbaClientDelegateImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #10
Source Project: hottub   Author: dsrg-uoft   File: CorbaClientDelegateImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #11
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject waitForResponse()
{
    if (getRequestHeader().isResponseExpected()) {
        return connection.waitForResponse(this);
    }
    return null;
}
 
Example #12
Source Project: openjdk-8   Author: bpupadhyaya   File: CorbaClientRequestDispatcherImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected String peekUserExceptionId(InputObject inputObject)
{
    CDRInputObject cdrInputObject = (CDRInputObject) inputObject;
    // REVISIT - need interface for mark/reset
    cdrInputObject.mark(Integer.MAX_VALUE);
    String result = cdrInputObject.read_string();
    cdrInputObject.reset();
    return result;
}
 
Example #13
Source Project: openjdk-8-source   Author: keerath   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void endRequest(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB) messageMediator.getBroker();
    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest<-: " + opAndId(messageMediator));
    }

    // release NIO ByteBuffers to ByteBufferPool

    try {
        OutputObject outputObj = messageMediator.getOutputObject();
        if (outputObj != null) {
            outputObj.close();
        }
        InputObject inputObj = messageMediator.getInputObject();
        if (inputObj != null) {
            inputObj.close();
        }
    } catch (IOException ex) {
        // Given what close() does, this catch shouldn't ever happen.
        // See CDRInput/OutputObject.close() for more info.
        // It also won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest: IOException:" + ex.getMessage(), ex);
        }
    } finally {
        ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds();
    }
}
 
Example #14
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaClientDelegateImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #15
Source Project: openjdk-8   Author: bpupadhyaya   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #16
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void signalResponseReceived()
{
    // This will end up using the MessageMediator associated with
    // the original request instead of the current mediator (which
    // need to be constructed to hold the dispatchBuffer and connection).
    connection.getResponseWaitingRoom()
        .responseReceived((InputObject)inputObject);
}
 
Example #17
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #18
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaClientRequestDispatcherImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected String peekUserExceptionId(InputObject inputObject)
{
    CDRInputObject cdrInputObject = (CDRInputObject) inputObject;
    // REVISIT - need interface for mark/reset
    cdrInputObject.mark(Integer.MAX_VALUE);
    String result = cdrInputObject.read_string();
    cdrInputObject.reset();
    return result;
}
 
Example #19
Source Project: openjdk-8-source   Author: keerath   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #20
Source Project: jdk8u60   Author: chenghanpeng   File: CorbaClientDelegateImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #21
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #22
Source Project: hottub   Author: dsrg-uoft   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject waitForResponse()
{
    if (getRequestHeader().isResponseExpected()) {
        return connection.waitForResponse(this);
    }
    return null;
}
 
Example #23
Source Project: jdk8u60   Author: chenghanpeng   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #24
Source Project: openjdk-8-source   Author: keerath   File: SocketOrChannelAcceptorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #25
Source Project: jdk8u60   Author: chenghanpeng   File: SocketOrChannelAcceptorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #26
Source Project: hottub   Author: dsrg-uoft   File: CorbaResponseWaitingRoomImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public InputObject waitForResponse(MessageMediator mediator)
{
  CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator;

  try {

    InputObject returnStream = null;

    if (orb.transportDebugFlag) {
        dprint(".waitForResponse->: " + opAndId(messageMediator));
    }

    Integer requestId = messageMediator.getRequestIdInteger();

    if (messageMediator.isOneWay()) {
        // The waiter is removed in releaseReply in the same
        // way as a normal request.

        if (orb.transportDebugFlag) {
            dprint(".waitForResponse: one way - not waiting: "
                   + opAndId(messageMediator));
        }

        return null;
    }

    OutCallDesc call = out_calls.get(requestId);
    if (call == null) {
        throw wrapper.nullOutCall(CompletionStatus.COMPLETED_MAYBE);
    }

    synchronized(call.done) {

        while (call.inputObject == null && call.exception == null) {
            // Wait for the reply from the server.
            // The ReaderThread reads in the reply IIOP message
            // and signals us.
            try {
                if (orb.transportDebugFlag) {
                    dprint(".waitForResponse: waiting: "
                           + opAndId(messageMediator));
                }
                call.done.wait();
            } catch (InterruptedException ie) {};
        }

        if (call.exception != null) {
            if (orb.transportDebugFlag) {
                dprint(".waitForResponse: exception: "
                       + opAndId(messageMediator));
            }
            throw call.exception;
        }

        returnStream = call.inputObject;
    }

    // REVISIT -- exceptions from unmarshaling code will
    // go up through this client thread!

    if (returnStream != null) {
        // On fragmented streams the header MUST be unmarshaled here
        // (in the client thread) in case it blocks.
        // If the header was already unmarshaled, this won't
        // do anything
        // REVISIT: cast - need interface method.
        ((CDRInputObject)returnStream).unmarshalHeader();
    }

    return returnStream;

  } finally {
    if (orb.transportDebugFlag) {
        dprint(".waitForResponse<-: " + opAndId(messageMediator));
    }
  }
}
 
Example #27
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CorbaClientRequestDispatcherImpl.java    License: Apache License 2.0 4 votes vote down vote up
public InputObject marshalingComplete1(
        ORB orb, CorbaMessageMediator messageMediator)
    throws
        ApplicationException,
        org.omg.CORBA.portable.RemarshalException
{
    try {
        messageMediator.finishSendingRequest();

        if (orb.subcontractDebugFlag) {
            dprint(".marshalingComplete: " + opAndId(messageMediator)
                   + ": finished sending request");
        }

        return messageMediator.waitForResponse();

    } catch (RuntimeException e) {

        if (orb.subcontractDebugFlag) {
            dprint(".marshalingComplete: " + opAndId(messageMediator)
                   + ": exception: " + e.toString());
        }

        boolean retry  =
            getContactInfoListIterator(orb)
                .reportException(messageMediator.getContactInfo(), e);

        //Bug 6382377: must not lose exception in PI

        // Must run interceptor end point before retrying.
        Exception newException =
                orb.getPIHandler().invokeClientPIEndingPoint(
                ReplyMessage.SYSTEM_EXCEPTION, e);

        if (retry) {
            if (newException == e) {
                continueOrThrowSystemOrRemarshal(messageMediator,
                                                 new RemarshalException());
            } else {
                continueOrThrowSystemOrRemarshal(messageMediator,
                                                 newException);
            }
        } else {
            if (newException instanceof RuntimeException){
                throw (RuntimeException)newException;
            }
            else if (newException instanceof RemarshalException)
            {
                throw (RemarshalException)newException;
            }

            // NOTE: Interceptor ending point will run in releaseReply.
            throw e;
        }
        return null; // for compiler
    }
}
 
Example #28
Source Project: openjdk-8   Author: bpupadhyaya   File: ParserTable.java    License: GNU General Public License v2.0 4 votes vote down vote up
public InputObject createInputObject(
Broker broker, MessageMediator messageMediator) { return null; }
 
Example #29
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public InputObject getInputObject()
{
    return inputObject;
}
 
Example #30
public InputObject marshalingComplete1(
        ORB orb, CorbaMessageMediator messageMediator)
    throws
        ApplicationException,
        org.omg.CORBA.portable.RemarshalException
{
    try {
        messageMediator.finishSendingRequest();

        if (orb.subcontractDebugFlag) {
            dprint(".marshalingComplete: " + opAndId(messageMediator)
                   + ": finished sending request");
        }

        return messageMediator.waitForResponse();

    } catch (RuntimeException e) {

        if (orb.subcontractDebugFlag) {
            dprint(".marshalingComplete: " + opAndId(messageMediator)
                   + ": exception: " + e.toString());
        }

        boolean retry  =
            getContactInfoListIterator(orb)
                .reportException(messageMediator.getContactInfo(), e);

        //Bug 6382377: must not lose exception in PI

        // Must run interceptor end point before retrying.
        Exception newException =
                orb.getPIHandler().invokeClientPIEndingPoint(
                ReplyMessage.SYSTEM_EXCEPTION, e);

        if (retry) {
            if (newException == e) {
                continueOrThrowSystemOrRemarshal(messageMediator,
                                                 new RemarshalException());
            } else {
                continueOrThrowSystemOrRemarshal(messageMediator,
                                                 newException);
            }
        } else {
            if (newException instanceof RuntimeException){
                throw (RuntimeException)newException;
            }
            else if (newException instanceof RemarshalException)
            {
                throw (RemarshalException)newException;
            }

            // NOTE: Interceptor ending point will run in releaseReply.
            throw e;
        }
        return null; // for compiler
    }
}