Package net.jini.jrmp

Examples of net.jini.jrmp.JrmpExporter


                + "JrmpExporter:");

        switch (cType) {
        case NOARG_FACTORY:
            logger.log(Level.FINE, "        JrmpExporter()");
            return new JrmpExporter();
        case PORT_FACTORY:
            logger.log(Level.FINE, "        JrmpExporter(" + cPort + ");");
            return new JrmpExporter(cPort);
        case SOCKS_FACTORY:
            logger.log(Level.FINE,
                    "        JrmpExporter(" + cPort + ", " + cCsf + ", " + cSsf
                    + ");");
            return new JrmpExporter(cPort, cCsf, cSsf);
        case ID_FACTORY:
            logger.log(Level.FINE,
                    "        JrmpExporter(" + cId + ", " + cPort + ");");
            return new JrmpExporter(cId, cPort);
        case ID_SOCKS_FACTORY:
            logger.log(Level.FINE,
                    "        JrmpExporter(" + cId + ", " + cPort + ", " + cCsf
                    + ", " + cSsf + ");");
            return new JrmpExporter(cId, cPort, cCsf, cSsf);
        default:
            throw new java.lang.AssertionError(
                    "ERROR: unknown type of constructor " + cType
                    + " for constructing JrmpExporter in createJrmpExporter"
                    + " method.");
View Full Code Here


    /**
     * Creates an exporter with an underlying {@link JrmpExporter} that
     * exports on an anonymous port.
     */
    public InstantiatorAccessExporter() {
  this.exporter = new JrmpExporter();
    }
View Full Code Here

   
    public void shutdown() throws Exception {
    }
   
    public static void main(String[] args) throws Exception {
  testExport(new JrmpExporter());
 
  CountedSocketFactory csf = new CountedSocketFactory();
  testExport(new JrmpExporter(0, csf, csf));
  if (csf.clientSocketsCreated == 0 ||
      csf.serverSocketsCreated == 0 ||
      csf.serverSocketsAccepted == 0)
  {
      throw new Error();
View Full Code Here

    public TestActivatableExport(ActivationID id, MarshalledObject mobj)
  throws Exception
    {
  this.id = id;
  csf = (CountedSocketFactory) mobj.get();
  exporter = new JrmpExporter(id, 0, csf, csf);
  stub = exporter.export(this);
    }
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        JrmpExporter je = createJrmpExporter();

        try {
            je.unexport(true);

            // FAIL
            throw new TestException(
                    "IllegalStateException has not been thrown "
                    + "during invocation of unexport method with "
                    + "true as a parameter when no objects were previously "
                    + "exported via this JrmpExporter.");
        } catch (IllegalStateException ise) {
            // PASS
            logger.log(Level.FINE,
                    "IllegalStateException has been thrown "
                    + "during invocation of unexport method with "
                    + "true as a parameter as expected.");
        }

        try {
            je.unexport(false);

            // FAIL
            throw new TestException(
                    "IllegalStateException has not been thrown "
                    + "during invocation of unexport method with "
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        JrmpExporter je1 = createJrmpExporter();
        TestRemoteObject tro = new TestRemoteObject();
        je1.export(tro);
        logger.log(Level.FINE,
                "Invoke unexport method of constructed"
                + " JrmpExporter1 with 'true' value...");
        boolean uRes = je1.unexport(true);

        if (!uRes) {
            // FAIL
            throw new TestException(
                    "performed unexport method invocation of constructed "
                    + "JrmpExporter1 with 'true' value has returned false "
                    + "while true is expected.");
        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        logger.log(Level.FINE,
                "Invoke unexport method of constructed"
                + " JrmpExporter1 with 'true' value again...");
        uRes = je1.unexport(true);

        if (!uRes) {
            // FAIL
            throw new TestException(
                    "performed unexport method invocation of constructed "
                    + "JrmpExporter1 with 'true' value again has returned "
                    + "false while true is expected.");
        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        logger.log(Level.FINE,
                "Invoke unexport method of constructed"
                + " JrmpExporter1 with 'false' value...");
        uRes = je1.unexport(false);

        if (!uRes) {
            // FAIL
            throw new TestException(
                    "performed unexport method invocation of constructed "
                    + "JrmpExporter1 with 'false' value has returned false "
                    + "while true is expected.");
        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        JrmpExporter je2 = createJrmpExporter();
        je2.export(tro);
        logger.log(Level.FINE,
                "Invoke unexport method of constructed"
                + " JrmpExporter2 with 'false' value...");
        uRes = je2.unexport(false);

        if (!uRes) {
            // FAIL
            throw new TestException(
                    "performed unexport method invocation of constructed "
                    + "JrmpExporter2 with 'false' value has returned false "
                    + "while true is expected.");
        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        logger.log(Level.FINE,
                "Invoke unexport method of constructed"
                + " JrmpExporter2 with 'false' value again...");
        uRes = je2.unexport(false);

        if (!uRes) {
            // FAIL
            throw new TestException(
                    "performed unexport method invocation of constructed "
                    + "JrmpExporter2 with 'false' value again has returned "
                    + "false while true is expected.");
        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        logger.log(Level.FINE,
                "Invoke unexport method of constructed"
                + " JrmpExporter2 with 'true' value...");
        uRes = je2.unexport(true);

        if (!uRes) {
            // FAIL
            throw new TestException(
                    "performed unexport method invocation of constructed "
                    + "JrmpExporter2 with 'true' value has returned false "
                    + "while true is expected.");
        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        JrmpExporter je3 = createJrmpExporter();
        TestRemoteInterface stub = (TestRemoteInterface) je3.export(tro);
        Unexporter u = new Unexporter(je3, false);
        logger.log(Level.FINE,
                "Start thread which will invoke unexport method"
                + " of constructed JrmpExporter3 with 'false' value...");
        u.start();
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        JrmpExporter je = createJrmpExporter();
        TestRemoteObjectWithoutStub trows = new TestRemoteObjectWithoutStub();

        try {
            je.export(trows);

            // FAIL
            throw new TestException(
                    "Export method invocation with remote object"
                    + " without stub class does not produce any"
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        JrmpExporter je = createJrmpExporter();
        TestRemoteObject tro1 = new TestRemoteObject("TestObject1");
        TestRemoteObject tro2 = new TestRemoteObject("TestObject2");
        je.export(tro1);

        try {
            je.export(tro1);

            // FAIL
            throw new TestException(
                    "IllegalStateException has not been thrown during "
                    + "second invocation of export method with the same "
                    + tro1 + " as a parameter.");
        } catch (IllegalStateException ise) {
            // PASS
            logger.log(Level.FINE,
                    "IllegalStateException has been thrown during "
                    + "second invocation of export method with the same "
                    + tro1 + " as a parameter as expected.");
        }

        try {
            je.export(tro2);

            // FAIL
            throw new TestException("IllegalStateException has not been thrown "
                    + "during invocation of export method with another"
                    + tro2 + " as a parameter.");
        } catch (IllegalStateException ise) {
            // PASS
            logger.log(Level.FINE,
                    "IllegalStateException has been thrown "
                    + "during invocation of export method with another "
                    + tro2 + " as a parameter as expected.");
        }

        // unexport test object
        je.unexport(true);
    }
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        JrmpExporter je = createJrmpExporter();
        RMIClientSocketFactory resCsf = je.getClientSocketFactory();

        if (cType == SOCKS_FACTORY || cType == ID_SOCKS_FACTORY) {
            if (!resCsf.equals(cCsf)) {
                // FAIL
                throw new TestException(
                        "getClientSocketFactory method of JrmpExporter "
                        + "with " + cCsf + " returns " + resCsf
                        + " as a result while " + cCsf + " is expected.");
            } else {
                // PASS
                logger.log(Level.FINE,
                        "getClientSocketFactory method of JrmpExporter"
                        + " with " + cCsf + " returns " + cCsf
                        + " as a result as expected.");
            }
            cCsf = null;
            je = createJrmpExporter();
            resCsf = je.getClientSocketFactory();

            if (resCsf != null) {
                // FAIL
                throw new TestException(
                        "getClientSocketFactory method of JrmpExporter "
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        JrmpExporter je = createJrmpExporter();
        int port = je.getPort();

        if (cType != NOARG_FACTORY) {
            if (port != cPort) {
                // FAIL
                throw new TestException(
                        "getPort method of JrmpExporter with " + cPort
                        + " port returns " + port + " as a result while "
                        + cPort + " is expected.");
            } else {
                // PASS
                logger.log(Level.FINE,
                        "getPort method of JrmpExporter with " + cPort
                        + " port returns " + cPort + " as expected.");
            }
            cPort = 0;
            je = createJrmpExporter();
            port = je.getPort();

            if (port != 0) {
                // FAIL
                throw new TestException(
                        "getPort method of JrmpExporter with "
View Full Code Here

TOP

Related Classes of net.jini.jrmp.JrmpExporter

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.