Package java.rmi.registry

Examples of java.rmi.registry.Registry.list()


   
        try {
        logger.debug("Locating registry on " + hostname);
            Registry registry = LocateRegistry.getRegistry(hostname);
           
            logger.info("Contents of registry: " + Arrays.toString(registry.list()));
           
            HelloIF stub = (HelloIF) registry.lookup(HelloIF.servicename);
        logger.info("Found '" + HelloIF.servicename + "' in registry");
           
        logger.trace("Calling sayhello()");
View Full Code Here


        // get a 'remote' reference on the registry
        Registry reg = LocateRegistry.getRegistry(registryPort);

        //
        // 'ping' the registry
        reg.list();
        registry = reg;
      }
      catch (Exception e)
      {
        if (debugEnabled())
View Full Code Here

                // we're in a web-app being 'hot' re-depoloyed, then the JVM
                // still
                // has the registry that we created above the first time...
                registry = LocateRegistry.getRegistry(resources
                        .getRMIRegistryPort());
                registry.list();
            } catch (Exception e) {
                registry = LocateRegistry.createRegistry(resources
                        .getRMIRegistryPort());
            }
        } else if (resources.getRMICreateRegistryStrategy().equals(
View Full Code Here

        try {
            // try to get existing registry
            final Registry registry = LocateRegistry.getRegistry(port);

            // test the registry
            registry.list();

            LOGGER.trace("using existing registry");

            return registry;
        } catch (RemoteException ex) {
View Full Code Here

        // get registry
        final Registry registry = LocateRegistry.getRegistry(port);

        // test registry
        registry.list();

        LOGGER.info("New RMI  Registry created using port: " + port);

        return registry;
    }
View Full Code Here

     * otherwise
     */
    public static boolean isRMIRegistryRunning(Configuration configuration, int port) {
        try {
            final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
            registry.list();
            return true;
        } catch (RemoteException ex) {
            return false;
        } catch (Exception e) {
            return false;
View Full Code Here

    public static boolean isServiceExported(Configuration configuration, int port, String serviceName) {
        if (serviceName == null)
            return false;
        try {
            final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
            String[] list = registry.list();

            if (list != null) {
                for (int i = 0; i < list.length; i++) {
                    if (serviceName.equals(list[i]))
                        return true;
View Full Code Here

        String testID = System.getProperty("testID");

        if ("Test1".equals(testID)) {
            try {
                Registry registry = LocateRegistry.getRegistry(4444);
                String[] list = registry.list();
                if ("jmxrmi".equals(list[0])) {
                    System.out.println(ok);
                } else {
                    System.out.println(ko);
                    throw new IllegalArgumentException(ko);
View Full Code Here

        }

        if ("Test2".equals(testID)) {
            try {
                Registry registry = LocateRegistry.getRegistry(4444);
                String[] list = registry.list();
                throw new IllegalArgumentException(ko2);
            } catch (Exception e) {
                System.out.println(okException);
                e.printStackTrace(System.out);
                return;
View Full Code Here

        if ("Test3".equals(testID)) {
            try {
                Registry registry = LocateRegistry.getRegistry(
                    null, 4444, new SslRMIClientSocketFactory());
                String[] list = registry.list();
                if ("jmxrmi".equals(list[0])) {
                    System.out.println(ok);
                } else {
                    System.out.println(ko);
                    throw new IllegalArgumentException(ko);
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.