Package java.rmi

Examples of java.rmi.Remote


    }

    public Remote findService(String host, String port, String svcName) throws RMIHostException,
        RMIHostRuntimeException {
        Registry registry;
        Remote remoteService = null;
        host = (host == null || host.length() <= 0) ? "localhost" : host;
        int portNumber = (port == null || port.length() <= 0) ? RMI_DEFAULT_PORT : Integer.decode(port);

        try {
            registry = LocateRegistry.getRegistry(host, portNumber);
View Full Code Here


        if ( port == null )
            throw new ServiceException( Messages.getMessage("noPort00", "" + portName) );

        // First, try to find a generated stub.  If that
        // returns null, then find a dynamic stub.
        Remote stub = getGeneratedStub(portName, proxyInterface);
        return stub != null ? stub : getPort(null, portName, proxyInterface);
    }
View Full Code Here

    public void testGetGeneratedStub() throws Exception {
        Service service = ServiceFactory.newInstance().createService(
                new URL("file:samples/addr/AddressBook.wsdl"),
                new QName("urn:AddressFetcher2", "AddressBookService"));
        QName portName = new QName("urn:AddressFetcher2", "AddressBook");
        Remote stub = service.getPort(portName, AddressBook.class);
        assertTrue("Stub should be an instance of AddressBookSOAPBindingStub; instead, it is " + stub.getClass().getName(), stub instanceof AddressBookSOAPBindingStub);
    } // testGetGeneratedStub
View Full Code Here

            final String rmiBindname = objects[i].getAttribute(this.RMI_OBJECT_BINDNAME);
            final boolean rmiBind = objects[i].getAttributeAsBoolean(this.RMI_OBJECT_BIND, false);
            final Configuration rmiObjectConf = objects[i].getChild(this.RMI_OBJECT_CONFIGURATION);
            try {
                Class classObject = Class.forName(rmiClass);
                Remote remote = (Remote)classObject.newInstance();
                // first of all, set logger
                if (remote instanceof LogEnabled) {
                    ((LogEnabled)remote).enableLogging(getLogger().getChildLogger(rmiBindname));
                }
                // Contextualizable, Composable, Configurable, Initializable
View Full Code Here

        if ( port == null )
            throw new ServiceException( JavaUtils.getMessage("noPort00", "" + portName) );

        // First, try to find a generated stub.  If that
        // returns null, then find a dynamic stub.
        Remote stub = getGeneratedStub(portName, proxyInterface);
        return stub != null ? stub : getPort(null, portName, proxyInterface);
    }
View Full Code Here

    }

    public Remote getPort(QName qName, Class portClass) throws ServiceException {
        if (qName != null) {
            String portName = qName.getLocalPart();
            Remote port = internalGetPort(portName);
            return port;
        }
        return getPort(portClass);
    }
View Full Code Here

        return getPort(portClass);
    }

    public Remote getPort(Class portClass) throws ServiceException {
        String fqcn = portClass.getName();
        Remote port = internalGetPortFromClassName(fqcn);
        return port;
    }
View Full Code Here

    }

    Remote internalGetPort(String portName) throws ServiceException {
        if (portToImplementationMap.containsKey(portName)) {
            SEIFactory seiFactory = (SEIFactory) portToImplementationMap.get(portName);
            Remote port = seiFactory.createServiceEndpoint();
            return port;
        }
        throw new ServiceException("No port for portname: " + portName);
    }
View Full Code Here

    }

    Remote internalGetPortFromClassName(String className) throws ServiceException {
        if (seiClassNameToFactoryMap.containsKey(className)) {
            SEIFactory seiFactory = (SEIFactory) seiClassNameToFactoryMap.get(className);
            Remote port = seiFactory.createServiceEndpoint();
            return port;
        }
        throw new ServiceException("no port for class " + className);
    }
View Full Code Here

        OperationInfo[] operationInfos = new OperationInfo[]{op};
        Class serviceEndpointClass = builder.enhanceServiceEndpointInterface(MockPort.class, context, module, isolatedCl);
        String portName = "foo";
        SEIFactory serviceInterfaceFactory = builder.createSEIFactory(null, portName, serviceEndpointClass, serviceInstance, Collections.EMPTY_LIST, location, operationInfos, handlerInfos, null, context, isolatedCl);
        assertNotNull(serviceInterfaceFactory);
        Remote serviceInterface = serviceInterfaceFactory.createServiceEndpoint();
        assertTrue(serviceInterface instanceof MockPort);
//        MockPort mockServiceInterface = (MockPort) serviceInterface;
//        mockServiceInterface.doMockOperation(null);
    }
View Full Code Here

TOP

Related Classes of java.rmi.Remote

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.