com.sun.corba.se.spi.activation.LocatorPackage.ServerLocation Java Examples

The following examples show how to use com.sun.corba.se.spi.activation.LocatorPackage.ServerLocation. 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: ServerManagerImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #2
Source File: ServerManagerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #3
Source File: ServerManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #4
Source File: ServerManagerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #5
Source File: ServerManagerImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #6
Source File: ServerManagerImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #7
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #8
Source File: ServerManagerImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #9
Source File: ServerManagerImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #10
Source File: ServerManagerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public ServerLocation locateServer (int serverId, String endpointType)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;
    if (debug)
        System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType=" +
                            endpointType + " block=true" ) ;

    // passing in entry to eliminate multiple lookups for
    // the same entry in some cases

    return locateServer(entry, endpointType, true);
}
 
Example #11
Source File: ServerManagerImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #12
Source File: ServerManagerImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #13
Source File: ServerManagerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #14
Source File: ServerManagerImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #15
Source File: ServerManagerImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #16
Source File: ServerManagerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #17
Source File: ServerManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #18
Source File: ServerManagerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #19
Source File: ServerManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #20
Source File: ServerManagerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #21
Source File: ServerManagerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #22
Source File: ServerManagerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #23
Source File: ServerManagerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #24
Source File: ServerManagerImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #25
Source File: ServerManagerImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #26
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #27
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #28
Source File: ServerManagerImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}
 
Example #29
Source File: ServerManagerImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void activate(int serverId)
    throws ServerAlreadyActive, ServerNotRegistered, ServerHeldDown
{

    ServerLocation   location;
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

    synchronized(serverTable) {
        entry = (ServerTableEntry) serverTable.get(key);
    }

    if (entry != null && entry.isActive()) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " failed because server is already active. " +
                                "entry = " + entry ) ;

        throw new ServerAlreadyActive( serverId );
    }

    // locate the server
    try {

        // We call getEntry here so that state of the entry is
        // checked for validity before we actually go and locate a server

        entry = getEntry(serverId);

        if (debug)
            System.out.println( "ServerManagerImpl: locateServer called with " +
                            " serverId=" + serverId + " endpointType="
                            + IIOP_CLEAR_TEXT.value + " block=false" ) ;

        location = locateServer(entry, IIOP_CLEAR_TEXT.value, false);

        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                serverId + " found location " +
                                location.hostname + " and activated it" ) ;
    } catch (NoSuchEndPoint ex) {
        if (debug)
            System.out.println( "ServerManagerImpl: activate for server Id " +
                                " threw NoSuchEndpoint exception, which was ignored" );
    }
}
 
Example #30
Source File: ServerManagerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private ServerLocation locateServer (ServerTableEntry entry, String endpointType,
                                    boolean block)
    throws NoSuchEndPoint, ServerNotRegistered, ServerHeldDown
{
    ServerLocation location = new ServerLocation() ;

    // if server location is desired, then wait for the server
    // to register back, then return location

    ORBPortInfo [] serverORBAndPortList;
    if (block) {
        try {
                serverORBAndPortList = entry.lookup(endpointType);
        } catch (Exception ex) {
            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                    "server held down" ) ;

            throw new ServerHeldDown( entry.getServerId() );
        }

        String host =
            orb.getLegacyServerSocketManager()
                .legacyGetEndpoint(LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT).getHostName();
        location.hostname = host ;
        int listLength;
        if (serverORBAndPortList != null) {
            listLength = serverORBAndPortList.length;
        } else {
            listLength = 0;
        }
        location.ports = new ORBPortInfo[listLength];
        for (int i = 0; i < listLength; i++) {
            location.ports[i] = new ORBPortInfo(serverORBAndPortList[i].orbId,
                    serverORBAndPortList[i].port) ;

            if (debug)
                System.out.println( "ServerManagerImpl: locateServer: " +
                                "server located at location " +
                                location.hostname + " ORBid  " +
                                serverORBAndPortList[i].orbId +
                                " Port " + serverORBAndPortList[i].port) ;
        }
    }

    return location;
}