com.sun.jini.start
Class SharedGroupImpl

java.lang.Object
  extended by com.sun.jini.start.SharedGroupImpl
All Implemented Interfaces:
SharedGroup, SharedGroupBackEnd, Remote, ProxyAccessor, ServerProxyTrust

public class SharedGroupImpl
extends Object
implements SharedGroupBackEnd, ServerProxyTrust, ProxyAccessor

The provided implementation of the SharedGroup service. The following items are discussed below:

Configuring SharedGroupImpl

This implementation of SharedGroupImpl supports the following configuration entries, with component com.sun.jini.start:
activationIdPreparer
  Type: ProxyPreparer
  Default: new BasicProxyPreparer()
  Description: The proxy preparer for the service's activation ID. The value should not be null. The service starter calls the activate method to activate the service.
activationSystemPreparer
  Type: ProxyPreparer
  Default: new BasicProxyPreparer()
  Description: The proxy preparer for the proxy for the activation system. The value should not be null. This entry is obtained at service start and restart. The service calls the unregisterGroup method on the ActivationSystem upon service destruction.
exporter
  Type: Exporter
  Default:
 new ActivationExporter(
     activationID,
     new BasicJeriExporter(
         TcpServerEndpoint.getInstance(0),
         new BasicILFactory(), false, true))
 
  Description: The object to use for exporting the service. The value should not be null. The call to getEntry will supply the activation ID in the data argument. This entry is obtained at service start and restart.

loginContext
  Type: LoginContext
  Default: null
  Description: If not null, specifies the JAAS login context to use for performing a JAAS login and supplying the Subject to use when running the service. If null, no JAAS login is performed. This entry is obtained at service start and restart.

Loggers and Logging Levels

The SharedGroupImpl service implementation uses the Logger, named com.sun.jini.sharedGroup. The following table describes the type of information logged as well as the levels of information logged.

com.sun.jini.start.sharedGroup
Level Description
FINE for low level service operation tracing
FINER for lower level service operation tracing
FINEST for lowest level service operation tracing

Author:
Sun Microsystems, Inc.

Nested Class Summary
private  class SharedGroupImpl.DestroyThread
          Termination thread code.
 
Field Summary
private  ActivationID activationID
          Our prepared activation ID reference
private  ActivationSystem activationSystem
          The prepared activation system reference
protected  Exporter exporter
          The exporter for exporting and unexporting
private static Logger logger
          Configure logger
private  LoginContext loginContext
          LoginContext for this service.
private  Remote ourStub
          The inner proxy of this server
private static String START_PACKAGE
          Component name for configuration entries
 
Constructor Summary
private SharedGroupImpl(ActivationID activationID, MarshalledObject data)
          Activation constructor.
 
Method Summary
private  void cleanup()
          Private utility method which attempts to roll back from from a failed initialization attempt.
 void destroyVM()
          Cause the hosting VM to exit.
private  void doInit(Configuration config)
           
private  void doInitWithLogin(Configuration config, LoginContext loginContext)
           
 Object getProxy()
          Returns a proxy object for this remote object.
 TrustVerifier getProxyVerifier()
          Returns a TrustVerifier that can be used to verify that a proxy can be trusted as a proxy for the service; that is, the isTrustedObject method of the returned verifier can be called with a candidate proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_PACKAGE

private static final String START_PACKAGE
Component name for configuration entries

See Also:
Constant Field Values

logger

private static final Logger logger
Configure logger


activationID

private ActivationID activationID
Our prepared activation ID reference


activationSystem

private ActivationSystem activationSystem
The prepared activation system reference


ourStub

private Remote ourStub
The inner proxy of this server


loginContext

private final LoginContext loginContext
LoginContext for this service.


exporter

protected Exporter exporter
The exporter for exporting and unexporting

Constructor Detail

SharedGroupImpl

private SharedGroupImpl(ActivationID activationID,
                        MarshalledObject data)
                 throws Exception
Activation constructor.

Throws:
Exception
Method Detail

doInitWithLogin

private void doInitWithLogin(Configuration config,
                             LoginContext loginContext)
                      throws Exception
Throws:
Exception

doInit

private void doInit(Configuration config)
             throws Exception
Throws:
Exception

destroyVM

public void destroyVM()
               throws RemoteException,
                      ActivationException
Description copied from interface: SharedGroup
Cause the hosting VM to exit. This method should (in effect) spawn a separate thread to do the actual work asynchronously, and make a reasonable attempt to let this remote call return successfully. As such, a successful return from this method does not mean that the VM has been destroyed. Although the service should make a reasonable attempt to let this remote call return successfully, the service must not wait indefinitely for other (in-progress and subsequent) remote calls to finish before proceeding to destroy its hosting VM. Once this method has been called, the service can, but need not, reject all other (in-progress and subsequent) remote calls to the service.

Specified by:
destroyVM in interface SharedGroup
Throws:
RemoteException - if there was a problem communicating with the shared group object
ActivationException - if there was a problem creating an activatable shared group instance

cleanup

private void cleanup()
Private utility method which attempts to roll back from from a failed initialization attempt.


getProxy

public Object getProxy()
Description copied from interface: ProxyAccessor
Returns a proxy object for this remote object. If this remote object is not exported (and hence, no proxy is available), then null is returned.

Specified by:
getProxy in interface ProxyAccessor
Returns:
a proxy, or null

getProxyVerifier

public TrustVerifier getProxyVerifier()
Description copied from interface: ServerProxyTrust
Returns a TrustVerifier that can be used to verify that a proxy can be trusted as a proxy for the service; that is, the isTrustedObject method of the returned verifier can be called with a candidate proxy. The verifier should be able to verify all proxies for the service, including proxies for resources (such as leases and registrations).

Specified by:
getProxyVerifier in interface ServerProxyTrust
Returns:
a TrustVerifier that can be used to verify that a proxy can be trusted as a proxy for the service


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.