com.sun.corba.se.spi.activation.ServerNotRegistered Java Examples

The following examples show how to use com.sun.corba.se.spi.activation.ServerNotRegistered. 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-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void active(int serverId, Server server) throws ServerNotRegistered
{
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

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

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called, but no such server is registered." ) ;

            throw wrapper.serverNotExpectedToRegister() ;
        } else {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called.  This server is now active." ) ;

            entry.register(server);
        }
    }
}
 
Example #2
Source File: ServerManagerImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void active(int serverId, Server server) throws ServerNotRegistered
{
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

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

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called, but no such server is registered." ) ;

            throw wrapper.serverNotExpectedToRegister() ;
        } else {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called.  This server is now active." ) ;

            entry.register(server);
        }
    }
}
 
Example #3
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void active(int serverId, Server server) throws ServerNotRegistered
{
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

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

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called, but no such server is registered." ) ;

            throw wrapper.serverNotExpectedToRegister() ;
        } else {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called.  This server is now active." ) ;

            entry.register(server);
        }
    }
}
 
Example #4
Source File: ServerManagerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerHeldDown, ServerAlreadyUninstalled
{
    ServerTableEntry entry =
        (ServerTableEntry) serverTable.get( new Integer(serverId) );

    if (entry != null) {

        entry =
            (ServerTableEntry) serverTable.remove(new Integer(serverId));

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: shutdown for server Id " +
                                serverId + " throws ServerNotActive." ) ;

            throw new ServerHeldDown( serverId );
        }

        entry.uninstall();
    }
}
 
Example #5
Source File: ServerManagerImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerHeldDown, ServerAlreadyUninstalled
{
    ServerTableEntry entry =
        (ServerTableEntry) serverTable.get( new Integer(serverId) );

    if (entry != null) {

        entry =
            (ServerTableEntry) serverTable.remove(new Integer(serverId));

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: shutdown for server Id " +
                                serverId + " throws ServerNotActive." ) ;

            throw new ServerHeldDown( serverId );
        }

        entry.uninstall();
    }
}
 
Example #6
Source File: ServerManagerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void active(int serverId, Server server) throws ServerNotRegistered
{
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

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

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called, but no such server is registered." ) ;

            throw wrapper.serverNotExpectedToRegister() ;
        } else {
            if (debug)
                System.out.println( "ServerManagerImpl: active for server Id " +
                                    serverId + " called.  This server is now active." ) ;

            entry.register(server);
        }
    }
}
 
Example #7
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerHeldDown, ServerAlreadyUninstalled
{
    ServerTableEntry entry =
        (ServerTableEntry) serverTable.get( new Integer(serverId) );

    if (entry != null) {

        entry =
            (ServerTableEntry) serverTable.remove(new Integer(serverId));

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: shutdown for server Id " +
                                serverId + " throws ServerNotActive." ) ;

            throw new ServerHeldDown( serverId );
        }

        entry.uninstall();
    }
}
 
Example #8
Source File: ServerManagerImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerHeldDown, ServerAlreadyUninstalled
{
    ServerTableEntry entry =
        (ServerTableEntry) serverTable.get( new Integer(serverId) );

    if (entry != null) {

        entry =
            (ServerTableEntry) serverTable.remove(new Integer(serverId));

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: shutdown for server Id " +
                                serverId + " throws ServerNotActive." ) ;

            throw new ServerHeldDown( serverId );
        }

        entry.uninstall();
    }
}
 
Example #9
Source File: ServerManagerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerHeldDown, ServerAlreadyUninstalled
{
    ServerTableEntry entry =
        (ServerTableEntry) serverTable.get( new Integer(serverId) );

    if (entry != null) {

        entry =
            (ServerTableEntry) serverTable.remove(new Integer(serverId));

        if (entry == null) {
            if (debug)
                System.out.println( "ServerManagerImpl: shutdown for server Id " +
                                serverId + " throws ServerNotActive." ) ;

            throw new ServerHeldDown( serverId );
        }

        entry.uninstall();
    }
}
 
Example #10
Source File: RepositoryImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private DBServerDef getDBServerDef(int serverId) throws ServerNotRegistered
{
    Integer id = new Integer(serverId);
    DBServerDef server = (DBServerDef) db.serverTable.get(id);

    if (server == null)
        throw new ServerNotRegistered( serverId );

    return server ;
}
 
Example #11
Source File: ServerManagerImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void install( int serverId )
    throws ServerNotRegistered, ServerHeldDown, ServerAlreadyInstalled
{
    ServerTableEntry entry = getRunningEntry( serverId ) ;
    if (entry != null) {
        repository.install( serverId ) ;
        entry.install() ;
    }
}
 
Example #12
Source File: RepositoryImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ServerDef getServer(int serverId) throws ServerNotRegistered
{
    DBServerDef server = getDBServerDef( serverId ) ;

    ServerDef serverDef = new ServerDef(server.applicationName, server.name,
                                        server.classPath, server.args, server.vmArgs);

    if (debug)
        System.out.println(
                           "RepositoryImpl: getServer for serverId " + serverId +
                           " returns " + printServerDef( serverDef ) ) ;

    return serverDef;
}
 
Example #13
Source File: RepositoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ServerDef getServer(int serverId) throws ServerNotRegistered
{
    DBServerDef server = getDBServerDef( serverId ) ;

    ServerDef serverDef = new ServerDef(server.applicationName, server.name,
                                        server.classPath, server.args, server.vmArgs);

    if (debug)
        System.out.println(
                           "RepositoryImpl: getServer for serverId " + serverId +
                           " returns " + printServerDef( serverDef ) ) ;

    return serverDef;
}
 
Example #14
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 #15
Source File: ServerManagerImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** This method is used to obtain the registered ports for an ORB.
* This is useful for custom Bad server ID handlers in ORBD.
*/
public ServerLocationPerORB locateServerForORB (int serverId, String orbId)
    throws InvalidORBid, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;

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

    if (debug)
        System.out.println( "ServerManagerImpl: locateServerForORB called with " +
                            " serverId=" + serverId + " orbId=" + orbId +
                            " block=true" ) ;
    return locateServerForORB(entry, orbId, true);
}
 
Example #16
Source File: RepositoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void unregisterServer(int serverId) throws ServerNotRegistered {

        DBServerDef server = null;
        Integer id = new Integer(serverId);

        synchronized (db) {

            // check to see if the server is registered
            server = (DBServerDef) db.serverTable.get(id);
            if (server == null)  {
                if (debug)
                    System.out.println(
                                       "RepositoryImpl: unregisterServer for serverId " +
                                       serverId + " called: server not registered" ) ;

                throw (new ServerNotRegistered());
            }

            // remove server from the database
            db.serverTable.remove(id);
            db.flush();
        }

        if (debug)
            System.out.println(
                               "RepositoryImpl: unregisterServer for serverId " + serverId +
                               " called" ) ;
    }
 
Example #17
Source File: RepositoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private DBServerDef getDBServerDef(int serverId) throws ServerNotRegistered
{
    Integer id = new Integer(serverId);
    DBServerDef server = (DBServerDef) db.serverTable.get(id);

    if (server == null)
        throw new ServerNotRegistered( serverId );

    return server ;
}
 
Example #18
Source File: RepositoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerAlreadyUninstalled
{
    DBServerDef server = getDBServerDef( serverId ) ;

    if (!server.isInstalled)
        throw new ServerAlreadyUninstalled( serverId ) ;
    else {
        server.isInstalled = false ;
        db.flush() ;
    }
}
 
Example #19
Source File: RepositoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public int getServerID(String applicationName) throws ServerNotRegistered {
    synchronized (db) {
        int result = -1 ;

        for (Enumeration serverIds = db.serverTable.keys();
             serverIds.hasMoreElements();)
            {
                Integer nextServerId = (Integer) serverIds.nextElement();
                DBServerDef dbServerDef =
                    (DBServerDef) db.serverTable.get(nextServerId);

                if (dbServerDef.applicationName.equals(applicationName)) {
                    result = nextServerId.intValue();
                    break ;
                }
            }

        if (debug)
            System.out.println("RepositoryImpl: getServerID for " +
                               applicationName + " is " + result ) ;

        if (result == -1) {
            throw (new ServerNotRegistered());
        } else {
            return result ;
        }
    }
}
 
Example #20
Source File: RepositoryImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerAlreadyUninstalled
{
    DBServerDef server = getDBServerDef( serverId ) ;

    if (!server.isInstalled)
        throw new ServerAlreadyUninstalled( serverId ) ;
    else {
        server.isInstalled = false ;
        db.flush() ;
    }
}
 
Example #21
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** This method is used to obtain the registered ports for an ORB.
* This is useful for custom Bad server ID handlers in ORBD.
*/
public ServerLocationPerORB locateServerForORB (int serverId, String orbId)
    throws InvalidORBid, ServerNotRegistered, ServerHeldDown
{
    ServerTableEntry entry = getEntry( serverId ) ;

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

    if (debug)
        System.out.println( "ServerManagerImpl: locateServerForORB called with " +
                            " serverId=" + serverId + " orbId=" + orbId +
                            " block=true" ) ;
    return locateServerForORB(entry, orbId, true);
}
 
Example #22
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 #23
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 #24
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private ServerTableEntry getRunningEntry( int serverId )
    throws ServerNotRegistered
{
    ServerTableEntry entry = getEntry( serverId ) ;

    try {
        // this is to see if the server has any listeners
        ORBPortInfo [] serverORBAndPortList = entry.lookup(IIOP_CLEAR_TEXT.value) ;
    } catch (Exception exc) {
        return null ;
    }
    return entry;

}
 
Example #25
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public String[] getORBNames(int serverId)
    throws ServerNotRegistered
{
    try {
        ServerTableEntry entry = getEntry( serverId ) ;
        return (entry.getORBList());
    } catch (Exception ex) {
        throw new ServerNotRegistered(serverId);
    }
}
 
Example #26
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private ServerTableEntry getEntry( int serverId )
    throws ServerNotRegistered
{
    Integer key = new Integer(serverId);
    ServerTableEntry entry = null ;

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

        if (debug)
            if (entry == null) {
                System.out.println( "ServerManagerImpl: getEntry: " +
                                    "no active server found." ) ;
            } else {
                System.out.println( "ServerManagerImpl: getEntry: " +
                                    " active server found " + entry + "." ) ;
            }

        if ((entry != null) && (!entry.isValid())) {
            serverTable.remove(key);
            entry = null;
        }

        if (entry == null) {
            ServerDef serverDef = repository.getServer(serverId);

            entry = new ServerTableEntry( wrapper,
                serverId, serverDef, initialPort, dbDirName, false, debug);
            serverTable.put(key, entry);
            entry.activate() ;
        }
    }

    return entry ;
}
 
Example #27
Source File: ServerManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void registerEndpoints( int serverId, String orbId,
    EndPointInfo [] endpointList ) throws NoSuchEndPoint, ServerNotRegistered,
    ORBAlreadyRegistered
{
    // orbId is ignored for now
    ServerTableEntry entry;
    Integer key = new Integer(serverId);

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

        if (entry == null) {
            if (debug)
                System.out.println(
                    "ServerManagerImpl: registerEndpoint for server Id " +
                    serverId + " called, but no such server is registered." ) ;

            throw wrapper.serverNotExpectedToRegister() ;
        } else {
            if (debug)
                System.out.println(
                    "ServerManagerImpl: registerEndpoints for server Id " +
                    serverId + " called.  This server is now active." ) ;

            entry.registerPorts( orbId, endpointList );

        }
    }
}
 
Example #28
Source File: RepositoryImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public int getServerID(String applicationName) throws ServerNotRegistered {
    synchronized (db) {
        int result = -1 ;

        for (Enumeration serverIds = db.serverTable.keys();
             serverIds.hasMoreElements();)
            {
                Integer nextServerId = (Integer) serverIds.nextElement();
                DBServerDef dbServerDef =
                    (DBServerDef) db.serverTable.get(nextServerId);

                if (dbServerDef.applicationName.equals(applicationName)) {
                    result = nextServerId.intValue();
                    break ;
                }
            }

        if (debug)
            System.out.println("RepositoryImpl: getServerID for " +
                               applicationName + " is " + result ) ;

        if (result == -1) {
            throw (new ServerNotRegistered());
        } else {
            return result ;
        }
    }
}
 
Example #29
Source File: RepositoryImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void uninstall( int serverId )
    throws ServerNotRegistered, ServerAlreadyUninstalled
{
    DBServerDef server = getDBServerDef( serverId ) ;

    if (!server.isInstalled)
        throw new ServerAlreadyUninstalled( serverId ) ;
    else {
        server.isInstalled = false ;
        db.flush() ;
    }
}
 
Example #30
Source File: RepositoryImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void install( int serverId )
    throws ServerNotRegistered, ServerAlreadyInstalled
{
    DBServerDef server = getDBServerDef( serverId ) ;

    if (server.isInstalled)
        throw new ServerAlreadyInstalled( serverId ) ;
    else {
        server.isInstalled = true ;
        db.flush() ;
    }
}