com.sun.corba.se.pept.protocol.MessageMediator Java Examples

The following examples show how to use com.sun.corba.se.pept.protocol.MessageMediator. 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: JDKSourceCode1.8   Author: wupeixuan   File: SharedCDRContactInfoImpl.java    License: MIT License 6 votes vote down vote up
public MessageMediator createMessageMediator(Broker broker,
                                             ContactInfo contactInfo,
                                             Connection connection,
                                             String methodName,
                                             boolean isOneWay)
{
    if (connection != null) {
        /// XXX LOGGING
        throw new RuntimeException("connection is not null");
    }

    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(
            (ORB) broker,
            contactInfo,
            null, // Connection;
            GIOPVersion.chooseRequestVersion( (ORB)broker,
                 effectiveTargetIOR),
            effectiveTargetIOR,
            requestId++, // Fake RequestId
            getAddressingDisposition(),
            methodName,
            isOneWay);

    return messageMediator;
}
 
Example #2
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: SharedCDRContactInfoImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public MessageMediator createMessageMediator(Broker broker,
                                             ContactInfo contactInfo,
                                             Connection connection,
                                             String methodName,
                                             boolean isOneWay)
{
    if (connection != null) {
        /// XXX LOGGING
        throw new RuntimeException("connection is not null");
    }

    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(
            (ORB) broker,
            contactInfo,
            null, // Connection;
            GIOPVersion.chooseRequestVersion( (ORB)broker,
                 effectiveTargetIOR),
            effectiveTargetIOR,
            requestId++, // Fake RequestId
            getAddressingDisposition(),
            methodName,
            isOneWay);

    return messageMediator;
}
 
Example #3
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CorbaClientRequestDispatcherImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void unregisterWaiter(ORB orb)
{
    MessageMediator messageMediator =
        orb.getInvocationInfo().getMessageMediator();
    if (messageMediator!=null && messageMediator.getConnection() != null) {
        // REVISIT:
        // The messageMediator may be null if COMM_FAILURE before
        // it is created.
        messageMediator.getConnection().unregisterWaiter(messageMediator);
    }
}
 
Example #4
Source Project: TencentKona-8   Author: Tencent   File: SharedCDRContactInfoImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public OutputObject createOutputObject(MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    // NOTE: GROW.
    OutputObject outputObject =
        sun.corba.OutputStreamFactory.newCDROutputObject(orb, messageMediator,
                            corbaMessageMediator.getRequestHeader(),
                            corbaMessageMediator.getStreamFormatVersion(),
                            BufferManagerFactory.GROW);
    messageMediator.setOutputObject(outputObject);
    return outputObject;
}
 
Example #5
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: CorbaResponseWaitingRoomImpl.java    License: MIT License 5 votes vote down vote up
public void registerWaiter(MessageMediator mediator)
{
    CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator;

    if (orb.transportDebugFlag) {
        dprint(".registerWaiter: " + opAndId(messageMediator));
    }

    Integer requestId = messageMediator.getRequestIdInteger();

    OutCallDesc call = new OutCallDesc();
    call.thread = Thread.currentThread();
    call.messageMediator = messageMediator;
    out_calls.put(requestId, call);
}
 
Example #6
Source Project: openjdk-jdk8u-backup   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 #7
Source Project: TencentKona-8   Author: Tencent   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 #8
Source Project: TencentKona-8   Author: Tencent   File: SocketOrChannelAcceptorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public OutputObject createOutputObject(Broker broker,
                                       MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return sun.corba.OutputStreamFactory.newCDROutputObject((ORB) broker,
                   corbaMessageMediator, corbaMessageMediator.getReplyHeader(),
                   corbaMessageMediator.getStreamFormatVersion());
}
 
Example #9
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: SocketOrChannelAcceptorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator finishCreatingMessageMediator(Broker broker,
                                                     Connection connection,
                                                     MessageMediator messageMediator)
{
    // REVISIT - no factoring so cheat to avoid code dup right now.
    // REVISIT **** COUPLING !!!!
    ContactInfo contactInfo = new SocketOrChannelContactInfoImpl();
    return contactInfo.finishCreatingMessageMediator(broker,
                                      connection, messageMediator);
}
 
Example #10
Source Project: TencentKona-8   Author: Tencent   File: CorbaResponseWaitingRoomImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void unregisterWaiter(MessageMediator mediator)
{
    CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator;

    if (orb.transportDebugFlag) {
        dprint(".unregisterWaiter: " + opAndId(messageMediator));
    }

    Integer requestId = messageMediator.getRequestIdInteger();

    out_calls.remove(requestId);
}
 
Example #11
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: SocketOrChannelAcceptorImpl.java    License: MIT License 5 votes vote down vote up
public OutputObject createOutputObject(Broker broker,
                                       MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return sun.corba.OutputStreamFactory.newCDROutputObject((ORB) broker,
                   corbaMessageMediator, corbaMessageMediator.getReplyHeader(),
                   corbaMessageMediator.getStreamFormatVersion());
}
 
Example #12
Source Project: TencentKona-8   Author: Tencent   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator finishCreatingMessageMediator(Broker broker,
                           Connection conn, MessageMediator messageMediator)
{
    ORB orb = (ORB) broker;
    CorbaConnection connection = (CorbaConnection) conn;
    CorbaMessageMediator corbaMessageMediator =
                  (CorbaMessageMediator)messageMediator;

    if (orb.transportDebugFlag) {
        dprint(
        ".finishCreatingMessageMediator: waiting for message body on connection: "
            + connection);
    }

    Message msg = corbaMessageMediator.getDispatchHeader();
    msg.setByteBuffer(corbaMessageMediator.getDispatchBuffer());

    // read giop body only
    msg = MessageBase.readGIOPBody(orb, connection, msg);

    ByteBuffer byteBuffer = msg.getByteBuffer();
    msg.setByteBuffer(null);
    corbaMessageMediator.setDispatchHeader(msg);
    corbaMessageMediator.setDispatchBuffer(byteBuffer);

    return corbaMessageMediator;
}
 
Example #13
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: OutputStreamFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static CDROutputObject newCDROutputObject(
        final ORB orb, final MessageMediator messageMediator,
        final Message header, final byte streamFormatVersion) {
    return AccessController.doPrivileged(
        new PrivilegedAction<CDROutputObject>() {
            @Override
            public CDROutputObject run() {
                return new CDROutputObject(orb, messageMediator,
                    header, streamFormatVersion);
            }
    });
}
 
Example #14
Source Project: openjdk-8   Author: bpupadhyaya   File: INSServerRequestDispatcher.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void dispatch(MessageMediator mediator)
{
    CorbaMessageMediator request = (CorbaMessageMediator) mediator;
    // send a locate forward with the right IOR. If the insKey is not
    // registered then it will throw OBJECT_NOT_EXIST Exception
    String insKey = new String( request.getObjectKey().getBytes(orb) );
    request.getProtocolHandler()
        .createLocationForward(request, getINSReference( insKey ), null);
    return;
}
 
Example #15
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: CorbaResponseWaitingRoomImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void registerWaiter(MessageMediator mediator)
{
    CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator;

    if (orb.transportDebugFlag) {
        dprint(".registerWaiter: " + opAndId(messageMediator));
    }

    Integer requestId = messageMediator.getRequestIdInteger();

    OutCallDesc call = new OutCallDesc();
    call.thread = Thread.currentThread();
    call.messageMediator = messageMediator;
    out_calls.put(requestId, call);
}
 
Example #16
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator createMessageMediator(Broker broker,Connection conn)
{
    ORB orb = (ORB) broker;
    CorbaConnection connection = (CorbaConnection) conn;

    if (orb.transportDebugFlag) {
        if (connection.shouldReadGiopHeaderOnly()) {
            dprint(
            ".createMessageMediator: waiting for message header on connection: "
            + connection);
        } else {
            dprint(
            ".createMessageMediator: waiting for message on connection: "
            + connection);
        }
    }

    Message msg = null;

    if (connection.shouldReadGiopHeaderOnly()) {
        // read giop header only
        msg = MessageBase.readGIOPHeader(orb, connection);
    } else {
        // read entire giop message
        msg = MessageBase.readGIOPMessage(orb, connection);
    }

    ByteBuffer byteBuffer = msg.getByteBuffer();
    msg.setByteBuffer(null);
    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(orb, connection, msg, byteBuffer);

    return messageMediator;
}
 
Example #17
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: CorbaResponseWaitingRoomImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator getMessageMediator(int requestId)
{
    Integer id = new Integer(requestId);
    OutCallDesc call = out_calls.get(id);
    if (call == null) {
        // This can happen when getting early reply fragments for a
        // request which has completed (e.g., client marshaling error).
        return null;
    }
    return call.messageMediator;
}
 
Example #18
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CorbaResponseWaitingRoomImpl.java    License: Apache License 2.0 5 votes vote down vote up
public void unregisterWaiter(MessageMediator mediator)
{
    CorbaMessageMediator messageMediator = (CorbaMessageMediator) mediator;

    if (orb.transportDebugFlag) {
        dprint(".unregisterWaiter: " + opAndId(messageMediator));
    }

    Integer requestId = messageMediator.getRequestIdInteger();

    out_calls.remove(requestId);
}
 
Example #19
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: SocketOrChannelAcceptorImpl.java    License: Apache License 2.0 5 votes vote down vote up
public MessageMediator createMessageMediator(Broker broker,
                                             Connection connection)
{
    // REVISIT - no factoring so cheat to avoid code dup right now.
    // REVISIT **** COUPLING !!!!
    ContactInfo contactInfo = new SocketOrChannelContactInfoImpl();
    return contactInfo.createMessageMediator(broker, connection);
}
 
Example #20
Source Project: openjdk-8-source   Author: keerath   File: SocketOrChannelAcceptorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator createMessageMediator(Broker broker,
                                             Connection connection)
{
    // REVISIT - no factoring so cheat to avoid code dup right now.
    // REVISIT **** COUPLING !!!!
    ContactInfo contactInfo = new SocketOrChannelContactInfoImpl();
    return contactInfo.createMessageMediator(broker, connection);
}
 
Example #21
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: SocketOrChannelAcceptorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public OutputObject createOutputObject(Broker broker,
                                       MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return sun.corba.OutputStreamFactory.newCDROutputObject((ORB) broker,
                   corbaMessageMediator, corbaMessageMediator.getReplyHeader(),
                   corbaMessageMediator.getStreamFormatVersion());
}
 
Example #22
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaResponseWaitingRoomImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator getMessageMediator(int requestId)
{
    Integer id = new Integer(requestId);
    OutCallDesc call = out_calls.get(id);
    if (call == null) {
        // This can happen when getting early reply fragments for a
        // request which has completed (e.g., client marshaling error).
        return null;
    }
    return call.messageMediator;
}
 
Example #23
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaContactInfoBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator finishCreatingMessageMediator(Broker broker,
                           Connection conn, MessageMediator messageMediator)
{
    ORB orb = (ORB) broker;
    CorbaConnection connection = (CorbaConnection) conn;
    CorbaMessageMediator corbaMessageMediator =
                  (CorbaMessageMediator)messageMediator;

    if (orb.transportDebugFlag) {
        dprint(
        ".finishCreatingMessageMediator: waiting for message body on connection: "
            + connection);
    }

    Message msg = corbaMessageMediator.getDispatchHeader();
    msg.setByteBuffer(corbaMessageMediator.getDispatchBuffer());

    // read giop body only
    msg = MessageBase.readGIOPBody(orb, connection, msg);

    ByteBuffer byteBuffer = msg.getByteBuffer();
    msg.setByteBuffer(null);
    corbaMessageMediator.setDispatchHeader(msg);
    corbaMessageMediator.setDispatchBuffer(byteBuffer);

    return corbaMessageMediator;
}
 
Example #24
Source Project: hottub   Author: dsrg-uoft   File: CorbaMessageMediatorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public boolean handleRequest(MessageMediator messageMediator)
{
    try {
        dispatchHeader.callback(this);
    } catch (IOException e) {
        // REVISIT - this should be handled internally.
        ;
    }
    return isThreadDone;
}
 
Example #25
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CorbaInvocationInfo.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setMessageMediator(MessageMediator messageMediator)
{
    this.messageMediator = messageMediator;
}
 
Example #26
Source Project: openjdk-8-source   Author: keerath   File: CDROutputStream.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setMessageMediator(MessageMediator messageMediator)
{
    this.corbaMessageMediator = (CorbaMessageMediator) messageMediator;
}
 
Example #27
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   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 #28
Source Project: TencentKona-8   Author: Tencent   File: ParserTable.java    License: GNU General Public License v2.0 4 votes vote down vote up
public OutputObject createOutputObject(
Broker broker, MessageMediator messageMediator) { return null; }
 
Example #29
Source Project: jdk8u60   Author: chenghanpeng   File: SocketOrChannelConnectionImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void unregisterWaiter(MessageMediator messageMediator)
{
    responseWaitingRoom.unregisterWaiter(messageMediator);
}
 
Example #30
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ParserTable.java    License: GNU General Public License v2.0 4 votes vote down vote up
public OutputObject createOutputObject(
Broker broker, MessageMediator messageMediator) { return null; }