FileDocCategorySizeDatePackage
AsTlsClientEnvSetter.javaAPI DocGlassfish v2 API6205Fri May 04 22:33:54 BST 2007com.sun.enterprise.admin.server.core.jmx.ssl

AsTlsClientEnvSetter

public class AsTlsClientEnvSetter extends Object
This class is meant specifically for the setup of client side environment when the server end of system jmx connector is started with TLS on. This means that the custom RMI/SSL socket factory is going to be downloaded to the node agent VM and then the client socket creation will happen.

Really speaking RMI Custom Socket Factory provision has some loopholes in it in that if the factory stub is downloaded from server, then there is no way to "configure" it from the standpoint of HandshakeCompletedListener and TrustManager provision. (Unless there were some standard classes to do it).

Hence the downloading of stub does not work here in its true spirit, because the stub class is actually going to be available to node agent in its system class path and hence the configuration of the same is possible.

What is not possible is connecting to RMI/TLS server end of system-jmx-connector by a client that does not have appserver classses in class path. But node agent is one of the internal clients to system-jmx-connector and hence there is no problem as such. But since we are really not using the "downloaded" stub, the true spirit of custom rmi client socket factories is not used.

The reason that this is a separate class is that the NodeAgent class that uses this one is a really large class and I did not want to add more to it. Also, since as of $Date: 2007/05/05 05:33:54 $ node agent runs the synchronization in a separate VM, this separate VM also needs to set this environment. It is not sufficient to set this environment only in Node agent. I am choosing this package for the lack of better one.

For the sake of uniformity, this class uses the {@link SunOneBasicX509TrustManager} which knows how to check the "server" certificate by looking into .asadmintruststore.

author
Kedar.Mhaswade@sun.com
since
Sun Java System Application Server 8.1ee

Fields Summary
final com.sun.appserv.management.client.AdminRMISSLClientSocketFactoryEnvImpl
env
Constructors Summary
public AsTlsClientEnvSetter()

        this.env = AdminRMISSLClientSocketFactoryEnvImpl.getInstance();
        //System.out.println("Doing RMI/TLS Client setup in this VM");
    
Methods Summary
private voidenableHandshake()

        env.setHandshakeCompletedListener(new HandshakeCompletedListenerImpl());
    
private voidenableTrace()

        env.setTrace(true);
    
private voidenableTrustManagement()

        final TrustManager[] tms = this.getTrustManagers();
        env.setTrustManagers(tms);
    
protected javax.net.ssl.TrustManager[]getTrustManagers()

        //return ( TrustAnyTrustManager.getInstanceArray() );
        return ( new TrustManager[]{new SunOneBasicX509TrustManager()} );
    
public voidsetup()

        //debugging is disabled
        //enableTrace();
        enableTrustManagement();
        enableHandshake();