Examples of RMIClient


Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

    /**
     * Is restart of instance required.
     */
    public boolean isInstanceRestartNeeded() {
        if (restartNeeded) {
            RMIClient channel = AdminChannel.getRMIClient(instanceName);
            boolean alreadyRestarted =
                    channel.hasRestartedSince(tsRestartNeededSince);
            if (alreadyRestarted) {
                restartNeeded = false;
            }
        }
        return restartNeeded;
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

   
    private static void shutdown() {       
        try {
            getLogger().log(Level.INFO, "nodeAgent.sending-stop");
            String agentName = getConfig().getRepositoryName();
            RMIClient rmiClient = AdminChannel.getRMIClient(agentName);               
            ShutdownEvent shutdownEvent = new ShutdownEvent(agentName, "true");    
            AdminEventResult result = rmiClient.sendNotification(shutdownEvent);           
        } catch(Exception ex) {        
            getLogger().log(Level.WARNING, "nodeAgent.exception", ex);
            System.exit(1);
       
    }      
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

                    "admin.server.core.mbean.config.instance_does_not_exist",
                    instanceName);
            throw new ControlException(msg);
        }
        boolean alive = false;
        RMIClient serverInstancePinger = AdminChannel.getRMIClient(instanceName);
        alive = serverInstancePinger.isAlive();
        if(alive)
        {
      String msg = localStrings.getString(
                    "admin.server.core.mbean.config.delete_alive_instance",
                    instanceName);
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

                }
            } catch (Exception e) {
                sLogger.log(Level.WARNING, e.getMessage(), e);
            }
        }
        RMIClient serverInstancePinger = AdminChannel.getRMIClient(instanceName);
        if (serverInstancePinger.getInstanceStatusCode() !=
            Status.kInstanceRunningCode) {
            return;
        }
        AdminEventResult multicastResult = AdminEventMulticaster.multicastEvent(
            event);
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

        {
            String msg = localStrings.getString( "admin.server.core.mbean.config.cannot_restart_admin_instance" );
            throw new IllegalStateException( msg );
        }
*/
        final RMIClient rmiClient = AdminChannel.getRMIClient(mInstanceName);

        if (rmiClient.getInstanceStatusCode() != Status.kInstanceRunningCode)
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.instance_not_running_cannot_restart" );
            throw new IllegalStateException( msg );
        }

        try
        {
            /* calling restart script */
            sLogger.log(Level.INFO, "mbean.restart_instance", mInstanceName);
            InstanceDefinition instance = new InstanceDefinition(
                                               mInstanceName,
                                               getHostAndPort().getPort());
            ServerManager.instance().restartServerInstance(instance);
            /*
             * There is certain time lapse between executing the subprocess
             * and updating the instance stub file on the disk. The following
             * check compensates for this time lapse. Moreover this check
             * seems to be more definitive than waiting for a random interval,
             * say 5 seconds.
             */
            int i = 0; int MAX_TIMES = 3;
            while ((rmiClient.getInstanceStatusCode() !=
                    Status.kInstanceNotRunningCode) && (i < MAX_TIMES))
            {
                Thread.currentThread().sleep(5000);
                i++;
            }
        }
        catch (Exception e)
        {
            throw new ControlException(e.getMessage());
        }
        ManagedInstanceTimer tt = new ManagedInstanceTimer(
            TIME_OUT_SECONDS, 0,
            new TimerCallback()
            {
                public boolean check() throws Exception
                {
                    return (rmiClient.getInstanceStatusCode() ==
                            Status.kInstanceRunningCode);
                }
            } );
        tt.run(); //synchronous

        if (rmiClient.getInstanceStatusCode() != Status.kInstanceRunningCode)
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.timeout_while_restarting_server" );
            try
            {
                stop(TIME_OUT_SECONDS);
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

    {
        AdminEventCache cache = AdminEventCache.getInstance(mInstanceName);
        boolean restartRequired = cache.isInstanceRestartNeeded();
        if(restartRequired)
        {
            RMIClient rc = AdminChannel.getRMIClient(mInstanceName);
            if(!rc.isAlive())
                restartRequired = false;
        }
        return restartRequired;
    }
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

    }

    private boolean isAlive()
    {
        boolean alive = false;
        RMIClient serverInstancePinger = AdminChannel.
                getRMIClient(mInstanceName);

        alive = serverInstancePinger.isAlive();
        return ( alive );
    }
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

        return ( alive );
    }

    private int getInstanceStatusCode() {
        int statusCode = Status.kInstanceNotRunningCode;
        RMIClient serverInstancePinger = AdminChannel.getRMIClient(mInstanceName);
        statusCode = serverInstancePinger.getInstanceStatusCode();
        return statusCode;
    }
View Full Code Here

Examples of com.sun.enterprise.admin.server.core.channel.RMIClient

       String msg = localStrings.getString(
            "admin.server.core.channel.impl.no_inst_name");
       throw new AdminEventListenerException(msg);
    }

    RMIClient client = AdminChannel.getRMIClient(inst);

    if (client == null) {
       String msg = localStrings.getString(
            "admin.server.core.channel.impl.no_rmi_client", inst);
       throw new AdminEventListenerException(msg);
    }
    boolean resNeeded = client.isRestartNeeded();

    if (event.getActionType() == DynamicReconfigEvent.ACTION_ENABLED) {
        if (resNeeded == true) {
            // can not set dynamic reconfig, throw exception
           String msg = localStrings.getString(
            "admin.server.core.channel.impl.restart_required", inst);
            throw new AdminEventListenerException(msg);
        }
    } else if (event.getActionType() == DynamicReconfigEvent.ACTION_DISABLED) {
        client.setRestartNeeded(true);
    }
  }
View Full Code Here

Examples of de.jetwick.rmi.RMIClient

        };
    }

    @Override
    protected RMIClient createRMIClient() {
        return new RMIClient(new Configuration()) {

            @Override
            public RMIClient init() {
                return this;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.