User: kimptoc Date: 01/09/01 12:50:31 Modified: src/main/org/jboss/ejb/plugins/jrmp/interfaces SecureSocketFactory.java StatefulHandleImpl.java Log: remove deprecated logging import, where possible, otherwise comment as needing replacement with log4j.... must find out how it is use.... would be good if the deprecation message pointed to an example to use... Revision Changes Path 1.9 +40 -39 jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/SecureSocketFactory.java Index: SecureSocketFactory.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/SecureSocketFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- SecureSocketFactory.java 2001/08/03 17:15:49 1.8 +++ SecureSocketFactory.java 2001/09/01 19:50:31 1.9 @@ -11,33 +11,34 @@ import java.rmi.server.*; import java.security.*; +// TODO this needs to be replaced with the log4j logging import org.jboss.logging.Logger; /** - * <b>NOT IN USE</b>? + * <b>NOT IN USE</b>? * * @deprecated This this class in use at all? - * - * @see <related> - * @author <a href="mailto:[EMAIL PROTECTED]">Rickard Öberg</a> - * @version $Revision: 1.8 $ + * + * @see <related> + * @author <a href="mailto:[EMAIL PROTECTED]">Rickard Öberg</a> + * @version $Revision: 1.9 $ */ public class SecureSocketFactory extends RMISocketFactory implements java.io.Serializable { // Constants ----------------------------------------------------- - + // Attributes ---------------------------------------------------- - + // Static -------------------------------------------------------- static ThreadLocal principals = new ThreadLocal(); - + static void setPrincipal(Principal p) { principals.set(p); } public static Principal getPrincipal() { return (Principal)principals.get(); } - + // Constructors -------------------------------------------------- - + // Public -------------------------------------------------------- public ServerSocket createServerSocket(int port) throws IOException @@ -50,22 +51,22 @@ { return new AuthenticatedSocket(host, port); } - + public boolean equals(Object obj) { - System.out.println(obj instanceof SecureSocketFactory); + System.out.println(obj instanceof SecureSocketFactory); return obj instanceof SecureSocketFactory; } - + public int hashCode() { return getClass().getName().hashCode(); } - - // Package protected --------------------------------------------- + // Package protected --------------------------------------------- + // Protected ----------------------------------------------------- - + // Private ------------------------------------------------------- // Inner classes ------------------------------------------------- @@ -77,19 +78,19 @@ { super(port); } - + public Socket accept() throws IOException { Socket s = new SecureSocket(); - + super.implAccept(s); - + return s; } - + } - + class SecureSocket extends Socket { @@ -99,13 +100,13 @@ InputStream in = super.getInputStream(); DataInputStream din = new DataInputStream(in); setPrincipal(new PrincipalImpl(din.readUTF())); - + Logger.debug("Connected user:"+getPrincipal()); - + return in; } } - + class AuthenticatedSocket extends Socket { @@ -114,34 +115,34 @@ { super(host, port); System.out.println("Create socket to "+host+" "+port); - - try - { - throw new Exception(); - } catch (Exception e) - { - e.printStackTrace(); - } - + + try + { + throw new Exception(); + } catch (Exception e) + { + e.printStackTrace(); + } + DataOutputStream out = new DataOutputStream(getOutputStream()); out.writeUTF(System.getProperty("user.name")); } } - + static class PrincipalImpl implements Principal { String name; - + PrincipalImpl(String name) { this.name = name; } - + public String getName() { return name; } - + public int hashCode() { return name.hashCode(); } - + public boolean equals(Object obj) { try @@ -152,7 +153,7 @@ return false; } } - + public String toString() { return name; } } } 1.9 +14 -15 jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulHandleImpl.java Index: StatefulHandleImpl.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulHandleImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- StatefulHandleImpl.java 2001/08/03 17:15:49 1.8 +++ StatefulHandleImpl.java 2001/09/01 19:50:31 1.9 @@ -15,22 +15,21 @@ import javax.ejb.EJBObject; import javax.naming.InitialContext; -import org.jboss.logging.Logger; /** * An EJB stateful session bean handle. - * + * * @author <a href="mailto:[EMAIL PROTECTED]">Rickard Öberg</a>. * @author <a href="mailto:[EMAIL PROTECTED]>Marc Fleury</a> * @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a> - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public class StatefulHandleImpl extends AbstractHandle implements Handle { // Constants ----------------------------------------------------- - + /** Serial Version Identifier. */ private static final long serialVersionUID = -2592509632957623102L; @@ -49,14 +48,14 @@ catch (Exception e) { e.printStackTrace(); throw new ExceptionInInitializerError(e); - } + } } - + // Attributes ---------------------------------------------------- /** The identity of the bean. */ protected final Object id; - + // Constructors -------------------------------------------------- /** @@ -75,7 +74,7 @@ super(handle, name); this.id = id; } - + // Public -------------------------------------------------------- /** @@ -97,20 +96,20 @@ finally { ctx.close(); } - + // Create a new MethodInvocation for distribution //System.out.println("I am about to invoke and getEJBOBject is "+getEJBObjectMethod.getName() +" My ID is "+id); RemoteMethodInvocation rmi = new RemoteMethodInvocation(null, GET_EJB_OBJECT, new Object[] { id }); - + // MF FIXME: WE DEFINITLY NEED THE SECURITY ON SUCH A CALL... // We also need a pointer to the TM...:( - + // Set the transaction context //rmi.setTransaction(tm != null? tm.getTransaction() : null); - + // Set the security stuff // MF fixme this will need to use "thread local" and therefore same construct as above // rmi.setPrincipal(sm != null? sm.getPrincipal() : null); @@ -118,7 +117,7 @@ // is the credential thread local? (don't think so... but...) //rmi.setPrincipal( getPrincipal() ); // rmi.setCredential( getCredential() ); - + // Invoke on the remote server, enforce marshalling MarshalledObject mo = new MarshalledObject(rmi); return (EJBObject)container.invokeHome(mo).get(); @@ -129,9 +128,9 @@ } // Package protected --------------------------------------------- - + // Protected ----------------------------------------------------- - + // Private ------------------------------------------------------- // Inner classes ------------------------------------------------- _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development