protected void bind() throws RemoteException, NamingException {
//if(System.getSecurityManager() == null) {// create and install a security manager
// System.setSecurityManager(new RMISecurityManager());
//}
final Remote stub;
if(rmiProtocol.equals(RMI_PROTOCOL_JRMP_SSL)) {
stub = UnicastRemoteObject.exportObject(this, exportPort, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory());
} else {
assert (rmiProtocol.equals(RMI_PROTOCOL_JRMP));
stub = UnicastRemoteObject.exportObject(this, exportPort, TimeoutSocketProdiver.createClientSocketFactory(), null);