com.sun.corba.se.pept.transport.ContactInfo Java Examples

The following examples show how to use com.sun.corba.se.pept.transport.ContactInfo. 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 File: CorbaContactInfoListImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
protected void addRemoteContactInfos(
    IOR  effectiveTargetIOR,
    List effectiveTargetIORContactInfoList)
{
    ContactInfo contactInfo;
    List socketInfos = orb.getORBData()
        .getIORToSocketInfo().getSocketInfo(effectiveTargetIOR);
    Iterator iterator = socketInfos.iterator();
    while (iterator.hasNext()) {
        SocketInfo socketInfo = (SocketInfo) iterator.next();
        String type = socketInfo.getType();
        String host = socketInfo.getHost().toLowerCase();
        int    port = socketInfo.getPort();
        contactInfo = createContactInfo(type, host, port);
        effectiveTargetIORContactInfoList.add(contactInfo);
    }
}
 
Example #2
Source File: SharedCDRContactInfoImpl.java    From JDKSourceCode1.8 with 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 #3
Source File: CorbaContactInfoListIteratorImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public CorbaContactInfoListIteratorImpl(
    ORB orb,
    CorbaContactInfoList corbaContactInfoList,
    ContactInfo primaryContactInfo,
    List listOfContactInfos)
{
    this.orb = orb;
    this.contactInfoList = corbaContactInfoList;
    this.primaryContactInfo = primaryContactInfo;
    if (listOfContactInfos != null) {
        // listOfContactInfos is null when used by the legacy
        // socket factory.  In that case this iterator is NOT used.
        this.effectiveTargetIORIterator = listOfContactInfos.iterator();
    }
    // List is immutable so no need to synchronize access.
    this.listOfContactInfos = listOfContactInfos;

    this.previousContactInfo = null;
    this.isAddrDispositionRetry = false;

    this.successContactInfo = null;
    this.failureContactInfo = null;
    this.failureException = null;

    primaryToContactInfo = orb.getORBData().getIIOPPrimaryToContactInfo();
}
 
Example #4
Source File: CorbaContactInfoBase.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public MessageMediator createMessageMediator(Broker broker,
                                             ContactInfo contactInfo,
                                             Connection connection,
                                             String methodName,
                                             boolean isOneWay)
{
    // REVISIT: Would like version, ior, requestid, etc., decisions
    // to be in client subcontract.  Cannot pass these to this
    // factory method because it breaks generic abstraction.
    // Maybe set methods on mediator called from subcontract
    // after creation?
    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(
            (ORB) broker,
            contactInfo,
            connection,
            GIOPVersion.chooseRequestVersion( (ORB)broker,
                 effectiveTargetIOR),
            effectiveTargetIOR,
            ((CorbaConnection)connection).getNextRequestId(),
            getAddressingDisposition(),
            methodName,
            isOneWay);

    return messageMediator;
}
 
Example #5
Source File: CorbaContactInfoBase.java    From openjdk-jdk9 with 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)
{
    // REVISIT: Would like version, ior, requestid, etc., decisions
    // to be in client subcontract.  Cannot pass these to this
    // factory method because it breaks generic abstraction.
    // Maybe set methods on mediator called from subcontract
    // after creation?
    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(
            (ORB) broker,
            contactInfo,
            connection,
            GIOPVersion.chooseRequestVersion( (ORB)broker,
                 effectiveTargetIOR),
            effectiveTargetIOR,
            ((CorbaConnection)connection).getNextRequestId(),
            getAddressingDisposition(),
            methodName,
            isOneWay);

    return messageMediator;
}
 
Example #6
Source File: CorbaContactInfoListIteratorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public CorbaContactInfoListIteratorImpl(
    ORB orb,
    CorbaContactInfoList corbaContactInfoList,
    ContactInfo primaryContactInfo,
    List listOfContactInfos)
{
    this.orb = orb;
    this.contactInfoList = corbaContactInfoList;
    this.primaryContactInfo = primaryContactInfo;
    if (listOfContactInfos != null) {
        // listOfContactInfos is null when used by the legacy
        // socket factory.  In that case this iterator is NOT used.
        this.effectiveTargetIORIterator = listOfContactInfos.iterator();
    }
    // List is immutable so no need to synchronize access.
    this.listOfContactInfos = listOfContactInfos;

    this.previousContactInfo = null;
    this.isAddrDispositionRetry = false;

    this.successContactInfo = null;
    this.failureContactInfo = null;
    this.failureException = null;

    primaryToContactInfo = orb.getORBData().getIIOPPrimaryToContactInfo();
}
 
Example #7
Source File: SharedCDRContactInfoImpl.java    From jdk8u60 with 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 #8
Source File: CorbaContactInfoListImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected void addRemoteContactInfos(
    IOR  effectiveTargetIOR,
    List effectiveTargetIORContactInfoList)
{
    ContactInfo contactInfo;
    List socketInfos = orb.getORBData()
        .getIORToSocketInfo().getSocketInfo(effectiveTargetIOR);
    Iterator iterator = socketInfos.iterator();
    while (iterator.hasNext()) {
        SocketInfo socketInfo = (SocketInfo) iterator.next();
        String type = socketInfo.getType();
        String host = socketInfo.getHost().toLowerCase();
        int    port = socketInfo.getPort();
        contactInfo = createContactInfo(type, host, port);
        effectiveTargetIORContactInfoList.add(contactInfo);
    }
}
 
Example #9
Source File: CorbaContactInfoListImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
protected void addRemoteContactInfos(
    IOR  effectiveTargetIOR,
    List effectiveTargetIORContactInfoList)
{
    ContactInfo contactInfo;
    List socketInfos = orb.getORBData()
        .getIORToSocketInfo().getSocketInfo(effectiveTargetIOR);
    Iterator iterator = socketInfos.iterator();
    while (iterator.hasNext()) {
        SocketInfo socketInfo = (SocketInfo) iterator.next();
        String type = socketInfo.getType();
        String host = socketInfo.getHost().toLowerCase();
        int    port = socketInfo.getPort();
        contactInfo = createContactInfo(type, host, port);
        effectiveTargetIORContactInfoList.add(contactInfo);
    }
}
 
Example #10
Source File: SharedCDRContactInfoImpl.java    From hottub with 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 #11
Source File: CorbaContactInfoListImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected void addRemoteContactInfos(
    IOR  effectiveTargetIOR,
    List effectiveTargetIORContactInfoList)
{
    ContactInfo contactInfo;
    List socketInfos = orb.getORBData()
        .getIORToSocketInfo().getSocketInfo(effectiveTargetIOR);
    Iterator iterator = socketInfos.iterator();
    while (iterator.hasNext()) {
        SocketInfo socketInfo = (SocketInfo) iterator.next();
        String type = socketInfo.getType();
        String host = socketInfo.getHost().toLowerCase();
        int    port = socketInfo.getPort();
        contactInfo = createContactInfo(type, host, port);
        effectiveTargetIORContactInfoList.add(contactInfo);
    }
}
 
Example #12
Source File: CorbaContactInfoListIteratorImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public CorbaContactInfoListIteratorImpl(
    ORB orb,
    CorbaContactInfoList corbaContactInfoList,
    ContactInfo primaryContactInfo,
    List listOfContactInfos)
{
    this.orb = orb;
    this.contactInfoList = corbaContactInfoList;
    this.primaryContactInfo = primaryContactInfo;
    if (listOfContactInfos != null) {
        // listOfContactInfos is null when used by the legacy
        // socket factory.  In that case this iterator is NOT used.
        this.effectiveTargetIORIterator = listOfContactInfos.iterator();
    }
    // List is immutable so no need to synchronize access.
    this.listOfContactInfos = listOfContactInfos;

    this.previousContactInfo = null;
    this.isAddrDispositionRetry = false;

    this.successContactInfo = null;
    this.failureContactInfo = null;
    this.failureException = null;

    primaryToContactInfo = orb.getORBData().getIIOPPrimaryToContactInfo();
}
 
Example #13
Source File: CorbaContactInfoListIteratorImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean reportException(ContactInfo contactInfo,
                               RuntimeException ex)
{
    this.failureContactInfo = (CorbaContactInfo)contactInfo;
    this.failureException = ex;
    if (ex instanceof COMM_FAILURE) {
        SystemException se = (SystemException) ex;
        if (se.completed == CompletionStatus.COMPLETED_NO) {
            if (hasNext()) {
                return true;
            }
            if (contactInfoList.getEffectiveTargetIOR() !=
                contactInfoList.getTargetIOR())
            {
                // retry from root ior
                updateEffectiveTargetIOR(contactInfoList.getTargetIOR());
                return true;
            }
        }
    }
    return false;
}
 
Example #14
Source File: CorbaContactInfoListIteratorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public boolean reportException(ContactInfo contactInfo,
                               RuntimeException ex)
{
    this.failureContactInfo = (CorbaContactInfo)contactInfo;
    this.failureException = ex;
    if (ex instanceof COMM_FAILURE) {
        SystemException se = (SystemException) ex;
        if (se.completed == CompletionStatus.COMPLETED_NO) {
            if (hasNext()) {
                return true;
            }
            if (contactInfoList.getEffectiveTargetIOR() !=
                contactInfoList.getTargetIOR())
            {
                // retry from root ior
                updateEffectiveTargetIOR(contactInfoList.getTargetIOR());
                return true;
            }
        }
    }
    return false;
}
 
Example #15
Source File: SharedCDRContactInfoImpl.java    From openjdk-8-source with 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 #16
Source File: CorbaContactInfoBase.java    From openjdk-8 with 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)
{
    // REVISIT: Would like version, ior, requestid, etc., decisions
    // to be in client subcontract.  Cannot pass these to this
    // factory method because it breaks generic abstraction.
    // Maybe set methods on mediator called from subcontract
    // after creation?
    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(
            (ORB) broker,
            contactInfo,
            connection,
            GIOPVersion.chooseRequestVersion( (ORB)broker,
                 effectiveTargetIOR),
            effectiveTargetIOR,
            ((CorbaConnection)connection).getNextRequestId(),
            getAddressingDisposition(),
            methodName,
            isOneWay);

    return messageMediator;
}
 
Example #17
Source File: CorbaContactInfoListIteratorImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public boolean reportException(ContactInfo contactInfo,
                               RuntimeException ex)
{
    this.failureContactInfo = (CorbaContactInfo)contactInfo;
    this.failureException = ex;
    if (ex instanceof COMM_FAILURE) {
        SystemException se = (SystemException) ex;
        if (se.completed == CompletionStatus.COMPLETED_NO) {
            if (hasNext()) {
                return true;
            }
            if (contactInfoList.getEffectiveTargetIOR() !=
                contactInfoList.getTargetIOR())
            {
                // retry from root ior
                updateEffectiveTargetIOR(contactInfoList.getTargetIOR());
                return true;
            }
        }
    }
    return false;
}
 
Example #18
Source File: CorbaContactInfoBase.java    From openjdk-jdk8u with 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)
{
    // REVISIT: Would like version, ior, requestid, etc., decisions
    // to be in client subcontract.  Cannot pass these to this
    // factory method because it breaks generic abstraction.
    // Maybe set methods on mediator called from subcontract
    // after creation?
    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(
            (ORB) broker,
            contactInfo,
            connection,
            GIOPVersion.chooseRequestVersion( (ORB)broker,
                 effectiveTargetIOR),
            effectiveTargetIOR,
            ((CorbaConnection)connection).getNextRequestId(),
            getAddressingDisposition(),
            methodName,
            isOneWay);

    return messageMediator;
}
 
Example #19
Source File: CorbaContactInfoListIteratorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public CorbaContactInfoListIteratorImpl(
    ORB orb,
    CorbaContactInfoList corbaContactInfoList,
    ContactInfo primaryContactInfo,
    List listOfContactInfos)
{
    this.orb = orb;
    this.contactInfoList = corbaContactInfoList;
    this.primaryContactInfo = primaryContactInfo;
    if (listOfContactInfos != null) {
        // listOfContactInfos is null when used by the legacy
        // socket factory.  In that case this iterator is NOT used.
        this.effectiveTargetIORIterator = listOfContactInfos.iterator();
    }
    // List is immutable so no need to synchronize access.
    this.listOfContactInfos = listOfContactInfos;

    this.previousContactInfo = null;
    this.isAddrDispositionRetry = false;

    this.successContactInfo = null;
    this.failureContactInfo = null;
    this.failureException = null;

    primaryToContactInfo = orb.getORBData().getIIOPPrimaryToContactInfo();
}
 
Example #20
Source File: CorbaOutboundConnectionCacheImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void remove(ContactInfo contactInfo)
{
    if (orb.transportDebugFlag) {
        dprint(".remove: " + contactInfo + " " + contactInfo.hashCode());
    }
    synchronized (backingStore()) {
        if (contactInfo != null) {
            connectionCache.remove(contactInfo);
        }
        dprintStatistics();
    }
}
 
Example #21
Source File: SocketOrChannelAcceptorImpl.java    From openjdk-8 with 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 #22
Source File: SocketOrChannelAcceptorImpl.java    From JDKSourceCode1.8 with MIT License 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 #23
Source File: CorbaOutboundConnectionCacheImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void remove(ContactInfo contactInfo)
{
    if (orb.transportDebugFlag) {
        dprint(".remove: " + contactInfo + " " + contactInfo.hashCode());
    }
    synchronized (backingStore()) {
        if (contactInfo != null) {
            connectionCache.remove(contactInfo);
        }
        dprintStatistics();
    }
}
 
Example #24
Source File: CorbaOutboundConnectionCacheImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Connection get(ContactInfo contactInfo)
{
    if (orb.transportDebugFlag) {
        dprint(".get: " + contactInfo + " " + contactInfo.hashCode());
    }
    synchronized (backingStore()) {
        dprintStatistics();
        return (Connection) connectionCache.get(contactInfo);
    }
}
 
Example #25
Source File: SocketOrChannelAcceptorImpl.java    From openjdk-jdk8u-backup with 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 #26
Source File: CorbaOutboundConnectionCacheImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void put(ContactInfo contactInfo, Connection connection)
{
    if (orb.transportDebugFlag) {
        dprint(".put: " + contactInfo + " " + contactInfo.hashCode() + " "
               + connection);
    }
    synchronized (backingStore()) {
        connectionCache.put(contactInfo, connection);
        connection.setConnectionCache(this);
        dprintStatistics();
    }
}
 
Example #27
Source File: SocketOrChannelAcceptorImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #28
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 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 #29
Source File: CorbaOutboundConnectionCacheImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void remove(ContactInfo contactInfo)
{
    if (orb.transportDebugFlag) {
        dprint(".remove: " + contactInfo + " " + contactInfo.hashCode());
    }
    synchronized (backingStore()) {
        if (contactInfo != null) {
            connectionCache.remove(contactInfo);
        }
        dprintStatistics();
    }
}
 
Example #30
Source File: CorbaContactInfoListImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
protected ContactInfo createContactInfo(String type,
                                        String hostname, int port)
{
    return new SocketOrChannelContactInfoImpl(
        orb, this,
        // XREVISIT - See Base Line 62
        effectiveTargetIOR,
        orb.getORBData().getGIOPAddressDisposition(),
        type, hostname, port);
}