Package org.exolab.jms.net.registry

Examples of org.exolab.jms.net.registry.Registry


        }
        if (password != null) {
            properties.put(ORB.SECURITY_CREDENTIALS, password);
        }

        Registry registry;
        try {
            ORB orb = SharedORB.getInstance();
            registry = orb.getRegistry(properties);
        } catch (RemoteException exception) {
            JMSException error = new JMSException(
                    "Failed to get registry service for URL: " + url);
            error.setLinkedException(exception);
            throw error;
        }

        RemoteJmsAdminServerIfc admin = null;
        try {
            admin = (RemoteJmsAdminServerIfc) registry.lookup("admin");
            _connection = admin.createConnection(username, password);
        } catch (NotBoundException exception) {
            throw new JMSException("Administration server is not bound in the registry for "
                    + "URL: " + url);
        } catch (RemoteException exception) {
View Full Code Here


        if (user != null) {
            properties = new HashMap(_properties);
            properties.put(ORB.SECURITY_PRINCIPAL, user);
            properties.put(ORB.SECURITY_CREDENTIALS, password);
        }
        Registry registry = null;
        try {
            if (_orb == null) {
                _orb = SharedORB.getInstance();
            }
            registry = _orb.getRegistry(properties);
        } catch (AccessException exception) {
            JMSSecurityException error = new JMSSecurityException(
                    exception.getMessage());
            error.setLinkedException(exception);
            throw error;
        } catch (RemoteException exception) {
            JMSException error = new JMSException(
                    "Failed to get registry service for URL: " + _serverURI);
            error.setLinkedException(exception);
            throw error;
        }

        try {
            factory = (ServerConnectionFactory) registry.lookup("server");
        } catch (NotBoundException exception) {
            throw new JMSException(
                    "Server is not bound in the registry for URL: "
                    + _serverURI);
        } catch (RemoteException exception) {
View Full Code Here

        map(properties, Context.PROVIDER_URL, ORB.PROVIDER_URI);
        map(properties, Context.SECURITY_PRINCIPAL, ORB.SECURITY_PRINCIPAL);
        map(properties, Context.SECURITY_CREDENTIALS, ORB.SECURITY_CREDENTIALS);

        ORB orb;
        Registry registry;
        try {
            orb = SharedORB.getInstance();
            registry = orb.getRegistry(properties);
        } catch (RemoteException exception) {
            NamingException error = new CommunicationException(
                    "Failed to get registry service for URL: " + url);
            error.setRootCause(exception);
            throw error;
        }

        NamingProvider provider;
        try {
            provider = (NamingProvider) registry.lookup("jndi");
        } catch (NotBoundException exception) {
            throw new ServiceUnavailableException(
                    "JNDI service is not bound in the registry for URL: "
                    + url);
        } catch (RemoteException exception) {
View Full Code Here

        ORB server = getORB();
        server.getRegistry();

        // get the registry proxy. This will establish a connection to the
        // server.
        Registry registry = getRegistry();
        assertNotNull(registry);

        server.shutdown();

        if (!latch.attempt(10 * 1000)) {
View Full Code Here

        Proxy proxy = server.exportObject(serviceImpl);
        server.getRegistry().bind("service", proxy);

        ORB client = getClientORB();
        Registry registry = client.getRegistry(getConnectionProperties());
        CallbackService service = (CallbackService) registry.lookup("service");

        LoggingCallback callback = new LoggingCallback();
        Callback callbackProxy = (Callback) client.exportObjectTo(callback,
                                                                  getServerURI());
        service.addCallback(callbackProxy);
View Full Code Here

        server.getRegistry().bind("service", proxy);

        ORB client = getClientORB();
        client.addCallerListener(getServerURI(), listener);

        Registry registry = getRegistry(); // will establish a connection
        assertNotNull(registry);
        CallbackService service = (CallbackService) registry.lookup("service");
        assertNotNull(service);

        // make sure the connection isn't reaped through inactivity
        // while there are proxies associated with it.
        for (int i = 0; i < 10; ++i) {
View Full Code Here

     * Tests remote method invocation for primitives.
     *
     * @throws Exception for any error
     */
    public void testPrimitives() throws Exception {
        Registry registry = _orb.getRegistry(getConnectionProperties());
        EchoService echo = (EchoService) registry.lookup(ECHO_SERVICE);

        assertEquals(true, echo.echoBoolean(true));
        assertEquals(false, echo.echoBoolean(false));

        assertEquals(Byte.MIN_VALUE, echo.echoByte(Byte.MIN_VALUE));
View Full Code Here

     * @throws Exception for any error
     */
    public void testPrimitiveArrays() throws Exception {
        final int size = 4096;

        Registry registry = _orb.getRegistry(getConnectionProperties());
        EchoService echo = (EchoService) registry.lookup(ECHO_SERVICE);

        // byte arrays
        byte[] bytes = new byte[size];
        for (int i = 0; i < bytes.length; ++i) {
            bytes[i] = (byte) i;
View Full Code Here

     * @throws Exception for any error
     */
    public void testConcurrency() throws Exception {
        Thread[] threads = new Thread[10];

        Registry registry = _orb.getRegistry(getConnectionProperties());
        EchoService echo = (EchoService) registry.lookup(ECHO_SERVICE);

        for (int i = 0; i < threads.length; ++i) {
            threads[i] = new Thread(new IntInvoker(echo, i, 1000));
        }

View Full Code Here

        if (_routeURI != null) {
            _orb.addRoute(_uri, _routeURI);
        }

        if (_embeddedService) {
            Registry serverRegistry = _orb.getRegistry();

            Proxy proxy = _orb.exportObject(new EchoServiceImpl());
            serverRegistry.bind(ECHO_SERVICE, proxy);
        } else {
            Properties props = new Properties();
            final String key = "log4j.configuration";
            String log4j = System.getProperty(key);
            if (log4j != null) {
View Full Code Here

TOP

Related Classes of org.exolab.jms.net.registry.Registry

Copyright © 2018 www.massapicom. 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.