djencks 2005/10/20 18:19:23
Modified: modules/core/src/java/org/openejb/client Client.java
EJBHomeHandler.java EJBObjectHandler.java
EJBRequest.java JNDIContext.java
SocketConnectionFactory.java
Log:
OPENEJB-72 fix typos
Revision Changes Path
1.4 +2 -2
openejb/modules/core/src/java/org/openejb/client/Client.java
Index: Client.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/Client.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Client.java 28 Sep 2005 02:44:45 -0000 1.3
+++ Client.java 20 Oct 2005 22:19:23 -0000 1.4
@@ -74,7 +74,7 @@
} catch (IOException e){
throw new RemoteException("Cannot access server:
"+server.address+":"+server.port+" Exception: ", e );
} catch (Throwable e){
- throw new RemoteException("Cannot access server:
"+server.address+":"+server.port+" due to an unkown exception in the OpenEJB
client: ", e );
+ throw new RemoteException("Cannot access server:
"+server.address+":"+server.port+" due to an unknown exception in the OpenEJB
client: ", e );
}
/*----------------------------------*/
1.6 +11 -11
openejb/modules/core/src/java/org/openejb/client/EJBHomeHandler.java
Index: EJBHomeHandler.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/EJBHomeHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- EJBHomeHandler.java 1 Feb 2005 22:25:20 -0000 1.5
+++ EJBHomeHandler.java 20 Oct 2005 22:19:23 -0000 1.6
@@ -98,9 +98,9 @@
return null;
}
-
+
// protected abstract EJBObjectHandler newEJBObjectHandler();
-
+
public EJBHomeProxy createEJBHomeProxy() {
Class[] interfaces = new Class[]{EJBHomeProxy.class, ejb.homeClass};
return (EJBHomeProxy) ProxyManager.newProxyInstance(interfaces,
this, ejb.homeClass.getClassLoader());
@@ -124,7 +124,7 @@
//TODO
// Maybe turn this into Externalizable
} else {
- throw new UnsupportedOperationException("Unkown method:
" + method);
+ throw new UnsupportedOperationException("unknown method:
" + method);
}
} else if (method.getDeclaringClass() == EJBHomeProxy.class) {
if (method.equals(GETHANDLER)) {
@@ -133,10 +133,10 @@
return new EJBHomeProxyHandle(this);
} else if (methodName.equals("readResolve")) {
//TODO
- throw new UnsupportedOperationException("Unkown method:
" + method);
+ throw new UnsupportedOperationException("unknown method:
" + method);
// Maybe turn this into Externalizable
} else {
- throw new UnsupportedOperationException("Unkown method:
" + method);
+ throw new UnsupportedOperationException("unknown method:
" + method);
}
}
/*-------------------------------------------------------*/
@@ -175,10 +175,10 @@
} else if (method.getDeclaringClass() == ejb.homeClass) {
return homeMethod(method, args, proxy);
- /*-- UNKOWN ---------------------------------------------*/
+ /*-- unknown ---------------------------------------------*/
} else {
- throw new UnsupportedOperationException("Unkown method: " +
method);
+ throw new UnsupportedOperationException("unknown method: " +
method);
}
//TODO:1: Catch this in the server-side and return an OpenEJB
specific
@@ -192,9 +192,9 @@
}
/*-------------------------------------------------*/
- /* Home interface methods */
+ /* Home interface methods */
/*-------------------------------------------------*/
-
+
/**
* <P>
* Creates a new EJBObject and returns it to the
@@ -264,7 +264,7 @@
protected abstract Object findX(Method method, Object[] args, Object
proxy) throws Throwable;
/*-------------------------------------------------*/
- /* EJBHome methods */
+ /* EJBHome methods */
/*-------------------------------------------------*/
/**
1.6 +10 -10
openejb/modules/core/src/java/org/openejb/client/EJBObjectHandler.java
Index: EJBObjectHandler.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/EJBObjectHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- EJBObjectHandler.java 19 Apr 2005 05:02:01 -0000 1.5
+++ EJBObjectHandler.java 20 Oct 2005 22:19:23 -0000 1.6
@@ -70,7 +70,7 @@
* The registryId is a logical identifier that is used as a key when
placing EntityEJBObjectHandler into
* the BaseEjbProxyHanlder's liveHandleRegistry. EntityEJBObjectHandlers
that represent the same
* bean identity (keyed by the registry id) will be stored together so
that they can be removed together
- * when the EJBInvocationHandler.invalidateAllHandlers is invoked. The
EntityEJBObjectHandler uses a
+ * when the EJBInvocationHandler.invalidateAllHandlers is invoked. The
EntityEJBObjectHandler uses a
* compound key composed of the entity bean's primary key, deployment id,
and
* container id. This uniquely identifies the bean identity that is
proxied by this handler allowing it
* to be removed with other handlers bound to the same registry id.
@@ -81,7 +81,7 @@
EJBHomeProxy ejbHome = null;
// new Class []{javax.ejb.EntityContext.class}
-
+
public EJBObjectHandler() {
}
@@ -150,7 +150,7 @@
* This section is to be replaced by a more appropriate solution.
* This code is very temporary.
*/
-
+
try {
String methodName = m.getName();
@@ -165,7 +165,7 @@
} else if (m.equals(HASHCODE)) {
return new Integer(this.hashCode());
} else {
- throw new UnsupportedOperationException("Unkown method:
" + m);
+ throw new UnsupportedOperationException("unknown method:
" + m);
}
} else if (m.getDeclaringClass() == EJBObjectProxy.class) {
if (m.equals(GETHANDLER)) {
@@ -176,7 +176,7 @@
//TODO
// Maybe turn this into Externalizable
} else {
- throw new UnsupportedOperationException("Unkown method:
" + m);
+ throw new UnsupportedOperationException("unknown method:
" + m);
}
} else if (m.getDeclaringClass() == javax.ejb.EJBObject.class) {
if (m.equals(GETHANDLE)) {
@@ -190,12 +190,12 @@
} else if (m.equals(REMOVE)) {
retValue = remove(m, a, p);
} else {
- throw new UnsupportedOperationException("Unkown method:
" + m);
+ throw new UnsupportedOperationException("unknown method:
" + m);
}
} else if
(m.getDeclaringClass().isAssignableFrom(ejb.remoteClass)) {
retValue = businessMethod(m, a, p);
} else {
- throw new UnsupportedOperationException("Unkown method: " +
m);
+ throw new UnsupportedOperationException("unknown method: " +
m);
}
@@ -247,7 +247,7 @@
protected Object businessMethod(Method method, Object[] args, Object
proxy) throws Throwable {
// checkAuthorization(method);
// return container.invoke(deploymentID, method, args, primaryKey,
getThreadSpecificSecurityIdentity());
-
+
EJBRequest req = new EJBRequest(EJB_OBJECT_BUSINESS_METHOD);
req.setMethodParameters(args);
@@ -258,7 +258,7 @@
req.setPrimaryKey(primaryKey);
EJBResponse res = request(req);
-
+
// if (method.getName().equals("test36_returnEJBHome2")) {
//
System.out.println("\n\n----------------------------------------------------------");
// System.out.println(method.getName());
1.7 +6 -6
openejb/modules/core/src/java/org/openejb/client/EJBRequest.java
Index: EJBRequest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/EJBRequest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- EJBRequest.java 23 Mar 2005 08:23:16 -0000 1.6
+++ EJBRequest.java 20 Oct 2005 22:19:23 -0000 1.7
@@ -251,9 +251,9 @@
readRequestMethod(in);
readContainerId(in);
-
+
readClientIdentity(in);
-
+
readPrimaryKey(in);
readMethod(in);
@@ -267,7 +267,7 @@
try {
methodInstance = methodClass.getDeclaredMethod(methodName,
methodParamTypes);
} catch (NoSuchMethodException nsme) {
- throw (IOException)new IOException("Invalid EJB request
data.").initCause(nsme);
+ throw (IOException)new IOException("Invalid EJB request
data.").initCause(nsme);
}
}
@@ -394,7 +394,7 @@
out.writeShort(shortvalue);
} else {
- throw new IOException("Unkown primitive type: " + type);
+ throw new IOException("unknown primitive type: " + type);
}
} else {
if (obj instanceof PortableRemoteObject && obj instanceof
Remote) {
@@ -491,7 +491,7 @@
}
break;
default:
- throw new IOException("Unkown data type: " + type);
+ throw new IOException("unknown data type: " + type);
}
types[i] = clazz;
1.6 +31 -31
openejb/modules/core/src/java/org/openejb/client/JNDIContext.java
Index: JNDIContext.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/JNDIContext.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JNDIContext.java 25 Sep 2004 00:33:41 -0000 1.5
+++ JNDIContext.java 20 Oct 2005 22:19:23 -0000 1.6
@@ -53,11 +53,11 @@
import javax.naming.spi.InitialContextFactory;
/**
* JNDI client
- *
+ *
* @since 11/25/2001
*/
public class JNDIContext implements Serializable, InitialContextFactory,
Context, RequestMethods, ResponseCodes {
-
+
private transient String tail = "/";
private transient ServerMetaData server;
private transient Hashtable env;
@@ -66,7 +66,7 @@
* Constructs this JNDI context for the client.
*
* Opens a socket connection with the NamingServer.
- * Initializes object output/input streams for writing/reading
+ * Initializes object output/input streams for writing/reading
* objects with the naming server.
* Authenticates the user's information with the NamingServer
*
@@ -79,12 +79,12 @@
public JNDIContext(){
}
-
+
/*
* A neater version of clone
*/
public JNDIContext(JNDIContext that){
- this.tail = that.tail;
+ this.tail = that.tail;
this.server = that.server;
this.env = (Hashtable)that.env.clone();
}
@@ -93,7 +93,7 @@
* Initializes this JNDI context for the client.
*
* Opens a socket connection with the NamingServer.
- * Initializes object output/input streams for writing/reading
+ * Initializes object output/input streams for writing/reading
* objects with the naming server.
* Authenticates the user's information with the NamingServer
*
@@ -123,7 +123,7 @@
//-------------------------------------------------------------//
// InitialContextFactory implementation //
//-------------------------------------------------------------//
-
+
/**
* Creates an Initial Context for beginning name resolution.
* Special requirements of this context are supplied
@@ -134,7 +134,7 @@
* to it, although it may keep a reference to a clone or copy.
*
* @param environment The possibly null environment
- * specifying information to be used in the creation
+ * specifying information to be used in the creation
* of the initial context.
* @return A non-null initial context object that implements the Context
* interface.
@@ -153,7 +153,7 @@
// if (userID == null) throw new ConfigurationException("Context
property cannot be null: "+Context.SECURITY_PRINCIPAL);
// if (psswrd == null) throw new ConfigurationException("Context
property cannot be null: "+Context.SECURITY_CREDENTIALS);
if (serverURL == null) throw new ConfigurationException("Context
property cannot be null: "+Context.PROVIDER_URL);
-
+
URL url;
if ( serverURL instanceof String ) {
try {
@@ -167,23 +167,23 @@
} else {
throw new ConfigurationException("Invalid provider URL:
"+serverURL);
}
-
+
try {
server = new ServerMetaData();
server.address = InetAddress.getByName( url.getHost() );
server.port = url.getPort();
} catch (UnknownHostException e){
- throw new ConfigurationException("Invalid provider
URL:"+serverURL+": host unkown: "+e.getMessage());
+ throw new ConfigurationException("Invalid provider
URL:"+serverURL+": host unknown: "+e.getMessage());
}
-
- //TODO:1: Either aggressively initiate authentication or wait for
the
+
+ //TODO:1: Either aggressively initiate authentication or wait for the
// server to send us an authentication challange.
authenticate(userID, psswrd);
return this;
}
-
-
+
+
public void authenticate(String userID, String psswrd) throws
javax.naming.AuthenticationException{
// TODO:1: Skip this if the identity hasn't been changed and
// the user already has been authenticated.
@@ -195,7 +195,7 @@
} catch (java.rmi.RemoteException e) {
throw new
javax.naming.AuthenticationException(e.getLocalizedMessage());
}
-
+
switch (res.getResponseCode()) {
case AUTH_REDIRECT:
server = res.getServer();
@@ -204,22 +204,22 @@
throw new javax.naming.AuthenticationException("This
principle is not authorized.");
}
}
-
+
// Construct a new handler and proxy.
public EJBHomeProxy createEJBHomeProxy(EJBMetaDataImpl ejbData){
-
+
EJBHomeHandler handler =
EJBHomeHandler.createEJBHomeHandler(ejbData, server);
EJBHomeProxy proxy = handler.createEJBHomeProxy();
handler.ejb.ejbHomeProxy = proxy;
-
+
return proxy;
-
+
}
-
+
//-------------------------------------------------------------//
// Context implementation //
//-------------------------------------------------------------//
-
+
//----------------------------------------------------------------------//
// Supportted methods
//
//----------------------------------------------------------------------//
@@ -243,25 +243,25 @@
case JNDI_EJBHOME:
// Construct a new handler and proxy.
return createEJBHomeProxy( (EJBMetaDataImpl)res.getResult()
);
-
- case JNDI_OK:
+
+ case JNDI_OK:
return res.getResult();
-
+
case JNDI_CONTEXT:
JNDIContext subCtx = new JNDIContext(this);
if (!name.endsWith("/")) name += '/';
subCtx.tail = name;
return subCtx;
-
- case JNDI_NOT_FOUND:
+
+ case JNDI_NOT_FOUND:
throw new NameNotFoundException(name + " not found");
-
+
case JNDI_NAMING_EXCEPTION:
throw (NamingException) res.getResult();
-
+
case JNDI_RUNTIME_EXCEPTION:
throw (RuntimeException) res.getResult();
-
+
case JNDI_ERROR:
throw (Error) res.getResult();
default:
1.5 +25 -25
openejb/modules/core/src/java/org/openejb/client/SocketConnectionFactory.java
Index: SocketConnectionFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/SocketConnectionFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SocketConnectionFactory.java 19 Jan 2005 00:12:22 -0000 1.4
+++ SocketConnectionFactory.java 20 Oct 2005 22:19:23 -0000 1.5
@@ -43,7 +43,7 @@
* $Id$
*/
package org.openejb.client;
-
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -52,24 +52,24 @@
import java.util.Properties;
/**
- *
+ *
*/
public class SocketConnectionFactory implements ConnectionFactory{
/**
* Prepares the ConnectionFactory for use. Called once right after
* the ConnectionFactory is instantiated.
- *
+ *
* @param props
*/
public void init(Properties props) {
}
-
+
/**
* Get a connection from the factory
- *
- * @return
+ *
+ * @return
* @exception java.io.IOException
*/
public Connection getConnection(ServerMetaData server) throws
java.io.IOException {
@@ -79,14 +79,14 @@
}
/**
- *
+ *
*/
class SocketConnection implements Connection{
-
+
Socket socket = null;
- OutputStream socketOut = null;
- InputStream socketIn = null;
-
+ OutputStream socketOut = null;
+ InputStream socketIn = null;
+
protected void open(ServerMetaData server) throws IOException {
/*-----------------------*/
/* Open socket to server */
@@ -96,16 +96,16 @@
socket.setTcpNoDelay(true);
} catch (IOException e){
throw new IOException("Cannot access server:
"+server.address+":"+server.port+" Exception: "+ e.getClass().getName() +" : "+
e.getMessage());
-
+
} catch (SecurityException e){
throw new IOException("Cannot access server:
"+server.address+":"+server.port+" due to security restrictions in the current
VM: "+ e.getClass().getName() +" : "+ e.getMessage());
-
+
} catch (Throwable e){
- throw new IOException("Cannot access server:
"+server.address+":"+server.port+" due to an unkown exception in the OpenEJB
client: "+ e.getClass().getName() +" : "+ e.getMessage());
+ throw new IOException("Cannot access server:
"+server.address+":"+server.port+" due to an unknown exception in the OpenEJB
client: "+ e.getClass().getName() +" : "+ e.getMessage());
}
-
+
}
-
+
public void close() throws IOException {
try {
if (socketOut != null) socketOut.close();
@@ -115,7 +115,7 @@
throw new IOException("Error closing connection with server:
"+t.getMessage() );
}
}
-
+
public InputStream getInputStream() throws IOException {
/*----------------------------------*/
/* Open input streams */
@@ -124,16 +124,16 @@
socketIn = socket.getInputStream();
} catch (StreamCorruptedException e){
throw new IOException("Cannot open input stream to server,
the stream has been corrupted: " + e.getClass().getName() +" : "+
e.getMessage());
-
+
} catch (IOException e){
throw new IOException("Cannot open input stream to server: "
+ e.getClass().getName() +" : "+ e.getMessage());
-
+
} catch (Throwable e){
throw new IOException("Cannot open output stream to server:
" + e.getClass().getName() +" : "+ e.getMessage());
- }
+ }
return socketIn;
}
-
+
public OutputStream getOuputStream() throws IOException {
/*----------------------------------*/
/* Openning output streams */
@@ -142,13 +142,13 @@
socketOut = socket.getOutputStream();
} catch (IOException e){
throw new IOException("Cannot open output stream to server:
"+ e.getClass().getName() +" : "+ e.getMessage());
-
+
} catch (Throwable e){
throw new IOException("Cannot open output stream to server:
"+ e.getClass().getName() +" : "+ e.getMessage());
- }
+ }
return socketOut;
}
-
+
}
}