Package net.jini.jeri

Examples of net.jini.jeri.BasicJeriExporter


        int listenPort = config.getIntConfigVal("com.sun.jini.test.spec.jeri"
            + ".basicjeriexporter.ConstructorTest.listenPort", 9090);
        ServerEndpoint se = new BJETestServerEndpoint(
            TcpServerEndpoint.getInstance(listenPort));
        InvocationLayerFactory ilf = new BJETestILFactory();
        BasicJeriExporter exporter = new BasicJeriExporter(se,ilf,false,false);
        //Verify that the ServerEnpoint used by the exporter is a custom
        //ServerEnpoint
        if (exporter.getServerEndpoint() instanceof BJETestServerEndpoint) {
            //Verify that the InvocationLayerFactory is an instance of
            //BasicILFactory
            if (exporter.getInvocationLayerFactory() instanceof
                BJETestILFactory){
                if (!exporter.getEnableDGC()){
                    if (!exporter.getKeepAlive()) {
                            //"Custom parameters constructor"
                            //+ " works as expected");
                    } else {
                        throw new TestException("Keep alive value"
                        + " is not set to false");
View Full Code Here


    public void run() throws Exception {
        //Construct a BasicJeriExporter using default parameters
        //Create an exporter instance
        int listenPort = config.getIntConfigVal("com.sun.jini.test.spec.jeri"
            + ".basicjeriexporter.listenPort", 9090);
        BasicJeriExporter exporter = new BasicJeriExporter(
            TcpServerEndpoint.getInstance(listenPort), new BJETestILFactory());
        BJETestService stub = null;
        BJETestServiceImpl service = new BJETestServiceImpl();
        try {
            //Export a remote object using the exporter constructed in step 1
            stub = (BJETestService)
                exporter.export(service);
        } catch (ExportException e) {
            log.fine("Exception thrown after call to export: "+ e.getMessage());
            throw new TestException(
                "Unexpected Exception after call to export",e);
        }
View Full Code Here

            .getHostAddress(), getPort(), getPort() + 1);
        Thread t = new Thread(rd);
        t.start();
        ((TestServerEndpoint) se).redirect(getPort() + 1);
        TestService service = new TestServiceImpl();
        BasicJeriExporter exporter = new BasicJeriExporter(se,
            new BasicILFactory());
        TestService stub = (TestService) exporter.export(service);
        //Obtain a message to send for the test
        byte[] ball = new byte[800];
        Arrays.fill(ball, (byte)0x88);
        stub.bounce(ball);
        rd.stop();
View Full Code Here

    public void run() throws Exception {
        //Register for instrumentation calls from the transport
        ConnectionTransportListener.registerListener(this);
        //initiate a listen operation
        TestServerEndpoint tse = new TestServerEndpoint(getListenPort());
        BasicJeriExporter exporter =
            new BasicJeriExporter(tse, new BasicILFactory());
        TestServiceImpl service = new TestServiceImpl();
        TestService stub = (TestService) exporter.export(service);
        TestEndpoint te = tse.getTestEndpoint();
        //make a call
        stub.doSomething();
        //Verify that the 3-arg connect method is called
        if (methodCalls.get(connect2)==null) {
View Full Code Here

     */
    public void run() throws Exception {
        //Create an exporter instance
        int listenPort = config.getIntConfigVal("com.sun.jini.test.spec.jeri"
            + ".basicjeriexporter.listenPort", 9090);
        BasicJeriExporter exporter = new BasicJeriExporter(
            TcpServerEndpoint.getInstance(listenPort), new BJETestILFactory());
        BJETestServiceImpl service = new BJETestServiceImpl();
        try {
            //Export a remote object using the exporter constructed in step 1
            BJETestService stub = (BJETestService)
                exporter.export(service);
        } catch (ExportException e) {
            log.fine("Exception thrown after first call to export: "
                + e.getMessage());
            throw new TestException(
                "Unexpected Exception after first call to export",e);
        }
        BJETestServiceImpl service2 = new BJETestServiceImpl();
        try {
            //Export another remote object using the same exporter that
            //was used in step 2
            BJETestService stub =
                (BJETestService) exporter.export(service2);
        } catch (IllegalStateException e) {
            //OK
        } catch (ExportException e) {
            log.fine("Unexpected exception thrown after second call to export: "
                + e.getMessage());
View Full Code Here

        Uuid id = UuidFactory.generate();
        //Create a BasicJeriExport instance using the ServerEndoint and Uuid
        //instances created above
        log.finest("Creating BasicJeriExporter with " + ep + ", EnableDGC=true"
            + " , keepAlive=true, " + id);
        BasicJeriExporter exporter =
            new BasicJeriExporter(ep,new BJETestILFactory(),true,true,id);
        //Export the remote object
        try {
            log.finest("Exporting " + exportee);
            exporter.export(exportee);
        } catch (ExportException e) {
            log.finer("Unexpected exception thrown while exporting service"
                + " " + e.getMessage());
            throw new TestException("Unsexpected ExportException"
                + " when exporting test service", e);
        }
        //Create a second BasicJeriExporter with the same Uuid and
        //ServerEnpoint
        log.finest("Creating second BasicJeriExporter with " + ep +
            ", EnableDGC=true , keepAlive=true, " + id);
        BasicJeriExporter secondExporter =
            new BasicJeriExporter(ep, new BJETestILFactory() ,true,true,id);
        //Export the remote object using the second exporter
        try {
            log.finest("Attempting second export using the same object, Uuid,"
                + " and ServerEnpoint");
            secondExporter.export(exportee);
            throw new TestException("An export exception was"
                + " not thrown when attempting to export the same object"
                + " twice with the same ServerEnpoint and Uuid");
        } catch (ExportException e) {
            //Verify that an export exception is thrown
View Full Code Here

    public void run() throws Exception {
        //Register for instrumentation calls from the transport
        ConnectionTransportListener.registerListener(this);
        //initiate a listen operation
        BasicJeriExporter exporter = new BasicJeriExporter(
        new TestServerEndpoint(getListenPort()), new BasicILFactory());
        TestServiceImpl service = new TestServiceImpl();
        TestService stub = (TestService) exporter.export(service);
        //send a request and receive a response
        stub.doSomething();
        //Verify that checkPermissions is called
        if (methodCalls.get(checkPermissions)==null) {
            throw new TestException("The ServerConnectionManager"
View Full Code Here

            .getHostAddress(), getPort(), getPort() + 1);
        Thread t = new Thread(rd);
        t.start();
        ((TestServerEndpoint) se).redirect(getPort() + 1);
        TestService service = new TestServiceImpl();
        BasicJeriExporter exporter = new BasicJeriExporter(se,
            new BasicILFactory());
        TestService stub = (TestService) exporter.export(service);
        //Obtain a message to send for the test
        byte[] ball = new byte[800];
        Arrays.fill(ball, (byte)0x88);
        stub.bounce(ball);
        rd.stop();
View Full Code Here

import net.jini.jeri.BasicJeriExporter;


public class TestServerEndpointTest {
    public static void main(String[] args) {
        BasicJeriExporter exporter = new BasicJeriExporter(new
            BJETestServerEndpoint(new TestServerEndpoint()),
                new BJETestILFactory());
        BJETestServiceImpl service = new BJETestServiceImpl();
        try {
            BJETestService stub = (BJETestService)
                exporter.export(service);
            System.out.println("Result of remote call: " + stub.doSomething());
            exporter.unexport(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

import net.jini.jeri.BasicJeriExporter;


public class TestServerEndpointTest {
    public static void main(String[] args) {
        BasicJeriExporter exporter = new BasicJeriExporter(
            new TestServerEndpoint(9090), new BasicILFactory());
        TestServiceImpl service = new TestServiceImpl();
        try {
            TestService stub = (TestService)
                exporter.export(service);
            System.out.println("Result of remote call: " + stub.doSomething());
            System.out.println("Result of remote call: " + stub.doSomething());
            exporter.unexport(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of net.jini.jeri.BasicJeriExporter

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.