Package java.rmi

Examples of java.rmi.Remote


  }

  /*
   * Export the remote object using the underlying exporter.
   */
  Remote uproxy = underlyingExporter.export(impl);
  used = true;
  boolean success = false;
 
  try {
      /*
       * Choose class loader for proxy's class.
       */
      Class uproxyClass = uproxy.getClass();
      ClassLoader proxyLoader;
      if (loader != null) {
    proxyLoader = loader;
      } else {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
        security.checkPermission(getClassLoaderPermission);
    }
    proxyLoader = uproxyClass.getClassLoader();
      }
 
      /*
       * Get superinterfaces of underlying proxy.
       */
      Set interfaceList = new LinkedHashSet();
      boolean isConstrainable = uproxy instanceof RemoteMethodControl;
      boolean checkPublic =
    !Modifier.isPublic(uproxyClass.getModifiers());
      getSuperinterfaces(interfaceList, uproxyClass,
             isConstrainable, checkPublic);
      Class[] proxyInterfaces = (Class[])
    interfaceList.toArray(new Class[interfaceList.size()]);
     
      /*
       * Create a dynamic proxy with an ActivatableInvocationHandler.
       */
      InvocationHandler handler =
    new ActivatableInvocationHandler(id, uproxy);
     
      Remote proxy = (Remote)
    Proxy.newProxyInstance(proxyLoader,
               proxyInterfaces,
               handler);
      success = true;
      return proxy;
View Full Code Here


    public Remote export(Remote impl) throws ExportException {
  if (!(impl instanceof ActivationInstantiator)) {
      throw new IllegalArgumentException(
              "not an ActivationInstantiator");
  }
  Remote wrapped = new InstantiatorImpl((ActivationInstantiator) impl);
  Remote proxy = exporter.export(wrapped);
  this.wrapped = wrapped;
  return proxy;
    }
View Full Code Here

      final ClassLoader savedCcl = t.getContextClassLoader();
      final ClassLoader ccl =
    covers(cl.getClassLoader(), savedCcl) ?
    cl.getClassLoader() : savedCcl;

      Remote impl = null;

      /*
       * Fix for 4164971: allow non-public activatable class
       * and/or constructor, create the activatable object in a
       * privileged block
View Full Code Here

  for (int i = 0; i < interfaces.length; i++) {
      Util.checkPackageAccess(interfaces[i].getClass());
  }
 
  Remote proxy;
  try {
      proxy = (Remote) Proxy.newProxyInstance(proxyLoader,
                interfaces,
                handler);
  } catch (IllegalArgumentException e) {
View Full Code Here

        entry.sequenceNum = sequenceNum;
    }

    if (!referencedSet.contains(clientID)) {
        if (referencedSet.isEmpty()) {
      Remote impl = implRef.getImpl();
      if (impl == null) {
          return// too late if impl was collected
      }
      implRef.pin(this);
        }
View Full Code Here

    }
    id = invocationDispatcher; // save for reference outside lock
    callsInProgress++;
      }
      try {
    Remote impl = implRef.getImpl();
    if (impl == null) {
        if (logger.isLoggable(Level.FINEST)) {
      logger.log(Level.FINEST,
          "this={0}, garbage collected", this);
        }
View Full Code Here

      throw new IllegalArgumentException("not an ActivationSystem");
  }
  if (!(impl instanceof ActivationAdmin)) {
      throw new IllegalArgumentException("not an ActivationAdmin");
  }
  Remote wrapped = new SystemImpl((ActivationSystem) impl, policy);
  Remote proxy = exporter.export(wrapped);
  this.wrapped = wrapped;
  return proxy;
    }
View Full Code Here

        // Start listener
        try
        {
            // Export server
            debug( "Exporting RMI object." );
            final Remote remote =
                UnicastRemoteObject.exportObject( m_server );
            m_serverStub = new MarshalledObject( remote );
        }
        catch( final IOException ioe )
        {
View Full Code Here

      return "iiop";
   }

   public Remote toStub() throws IOException
   {
      Remote remote = PortableRemoteObject.toStub(this);
      if (!(remote instanceof Stub)) throw new IOException("Could not find IIOP stub");
      return remote;
   }
View Full Code Here

      }
   }

   protected String encodeStub(RMIServerImpl rmiServer, Map environment) throws IOException
   {
      Remote stub = rmiServer.toStub();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = null;
      try
      {
         oos = new ObjectOutputStream(baos);
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.