Package java.rmi.server

Examples of java.rmi.server.ExportException


    /**
     * @tests serialization/deserialization.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new ExportException(errorMessage, cause), comparator);
    }
View Full Code Here


    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this, new ExportException(errorMessage, cause), comparator);
    }
View Full Code Here

    }

    void put(Target target) throws ExportException {
        Uuid id = target.getObjectIdentifier();
        if (id.equals(Jeri.DGC_ID)) {
            throw new ExportException(
                "object identifier reserved for DGC");
        }
        Target exists = idTable.putIfAbsent(id, target);
        if (exists != null){
            throw new ExportException(
                "object identifier already in use");
        }
        if (target.getEnableDGC()) {
            dgcEnabledCount.incrementAndGet();
        }
View Full Code Here

     * @throws ExportException if the remote object is not an instance of
     * {@link ServerProxyTrust} or implements any illegal remote interfaces
     **/
    protected Class[] getRemoteInterfaces(Remote impl) throws ExportException {
  if (impl != null && !(impl instanceof ServerProxyTrust)) {
      throw new ExportException("impl must implement ServerProxyTrust");
  }
  Class[] ifs = super.getRemoteInterfaces(impl);
  if (ifs == null) {
      return new Class[]{ProxyTrust.class};
  }
View Full Code Here

                  (Exporter)thisConfig.getEntry(COMPONENT_NAME,
                                                "eventListenerExporter",
                                                Exporter.class,
                                                defaultExporter );
            } catch(ConfigurationException e) {// exception, use default
                ExportException e1 = new ExportException
                                            ("Configuration exception while "
                                             +"retrieving exporter for "
                                             +"cache's remote event listener",
                                             e);
                throw e1;
View Full Code Here

        checkConstraints(serverCapabilities,
             (InvocationConstraints) iter.next());
    }
      }
  } catch (UnsupportedConstraintException e) {
      throw new ExportException(
    "server does not support some constraints", e);
  }
    }
View Full Code Here

  LinkedList ifaces = new LinkedList();
  Object boot = null;
  boolean ok = false;
  try {
      if (!(main instanceof RemoteMethodControl)) {
    throw new ExportException(
        "main proxy must implement RemoteMethodControl");
      } else if (!(main instanceof TrustEquivalence)) {
    throw new ExportException(
           "main proxy must implement TrustEquivalence");
      }
      boolean needPub = !Modifier.isPublic(c.getModifiers());
      for (Class sup = c; sup != null; sup = sup.getSuperclass()) {
    Class[] ifs = sup.getInterfaces();
    for (int i = ifs.length; --i >= 0; ) {
        if (needPub && !Modifier.isPublic(ifs[i].getModifiers())) {
      throw new ExportException(
        "main proxy implements non-public interface");
        }
        ifaces.remove(ifs[i]);
        ifaces.addFirst(ifs[i]);
    }
      }
      ref = new WeakRef(impl);
      synchronized (refs) {
    if (reaper == null) {
        reaper = new Reaper();
        systemThreadPool.execute(reaper,
               "ProxyTrustExporter.Reaper");
    }
    refs.add(ref);
      }
      boot = bootExporter.export(ref.boot);
      if (!(boot instanceof ProxyTrust)) {
    throw new ExportException(
           "bootstrap proxy must implement ProxyTrust");
      } else if (!(boot instanceof RemoteMethodControl)) {
    throw new ExportException(
       "bootstrap proxy must implement RemoteMethodControl");
      } else if (!(boot instanceof TrustEquivalence)) {
    throw new ExportException(
          "bootstrap proxy must implement TrustEquivalence");
      }
      Remote proxy = (Remote) Proxy.newProxyInstance(
        loader != null ? loader : c.getClassLoader(),
        (Class[]) ifaces.toArray(
                new Class[ifaces.size()]),
        new ProxyTrustInvocationHandler(
             (RemoteMethodControl) main,
             (ProxyTrust) boot));
      ok = true;
      return proxy;
  } catch (IllegalArgumentException e) {
      throw new ExportException("export failed", e);
  } finally {
      if (!ok) {
    if (ref != null) {
        ref.enqueue();
    }
View Full Code Here

      throw new NullPointerException();
  } else if (ref != null) {
      throw new IllegalStateException(
    "object already exported via this exporter");
  } else if (getTieClass(impl.getClass()) == null) {
      throw new ExportException("tie class unavailable");
  }
  ref = new WeakReference(impl);
 
  try {
      PortableRemoteObject.exportObject(impl);
      Remote proxy = PortableRemoteObject.toStub(impl);
      if (orb != null) {
    ((Stub) proxy).connect(orb);
      }
      if (logger.isLoggable(Level.FINE)) {
    logger.log(Level.FINE,
        "export of {0} via {1} returns proxy {2}",
        new Object[]{ impl, this, proxy });
      }
      return proxy;
  } catch (ExportException ex) {
      throw ex;
  } catch (RemoteException ex) {
      throw new ExportException("export failed", ex);
  }
    }
View Full Code Here

                                                              COMPONENT_NAME,
                                                              "serverExporter",
                                                              Exporter.class,
                                                              defaultExporter);
            } catch(ConfigurationException e) {
                throw new ExportException("Configuration exception while "
                                          +"retrieving service's exporter",
                                          e);
            }
            innerProxy =
                   (RemoteTestServiceInterface)serverExporter.export(this);
View Full Code Here

        /**
         * Always throws ExportException.
         */
        public Remote export(Remote impl) throws ExportException {
            throw new ExportException("Test exception.");
        }
View Full Code Here

TOP

Related Classes of java.rmi.server.ExportException

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.