User: hiram
Date: 00/12/25 20:15:59
Modified: src/java/org/spydermq/distributed/server
ConnectionReceiverOILClient.java
ConnectionReceiverUILClient.java
DistributedJMSServerOIL.java
DistributedJMSServerOILClient.java
DistributedJMSServerRMI.java
DistributedJMSServerRMIImpl.java
DistributedJMSServerUIL.java
DistributedJMSServerUILClient.java
Removed: src/java/org/spydermq/distributed/server
DistributedConnectionFactoryRMI.java
DistributedConnectionFactoryRMIImpl.java
DistributedConnectionFactoryRMIImplMBean.java
Log:
Fix a syschronization problem with the UIL and OIL classes. Now the
ASF can handle multiple messages without a problem. Removed all dependencys
the client had on the SecurityManger.
Revision Changes Path
1.14 +6 -7
spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverOILClient.java
Index: ConnectionReceiverOILClient.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverOILClient.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ConnectionReceiverOILClient.java 2000/12/23 15:48:20 1.13
+++ ConnectionReceiverOILClient.java 2000/12/26 04:15:56 1.14
@@ -11,6 +11,7 @@
import org.spydermq.SpyMessage;
import org.spydermq.Log;
import org.spydermq.SpyConnection;
+import org.spydermq.ReceiveRequest;
import java.rmi.RemoteException;
import java.io.ObjectOutputStream;
@@ -25,15 +26,13 @@
import java.net.InetAddress;
import java.net.SocketException;
-import org.spydermq.ReceiveRequest;
-
/**
* The UIL implementation of the ConnectionReceiver object
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.14 $
*/
public class ConnectionReceiverOILClient
implements ConnectionReceiver, Serializable
@@ -56,7 +55,7 @@
this.addr=addr;
}
- void createConnection() throws RemoteException
+ protected void createConnection() throws RemoteException
{
try {
socket=new Socket(addr,port);
@@ -69,7 +68,7 @@
}
}
- public void waitAnswer() throws Exception
+ protected void waitAnswer() throws Exception
{
Exception throwException=null;
try {
@@ -96,7 +95,7 @@
}
- public void deleteTemporaryDestination(SpyDestination dest) throws Exception
+ synchronized public void deleteTemporaryDestination(SpyDestination dest)
throws Exception
{
checkSocket();
out.writeByte(m_deleteTemporaryDestination);
@@ -104,7 +103,7 @@
waitAnswer();
}
- public void close() throws Exception
+ synchronized public void close() throws Exception
{
checkSocket();
out.writeByte(m_close);
@@ -116,7 +115,7 @@
if (socket==null) createConnection();
}
- public void receive(ReceiveRequest messages[]) throws Exception
+ synchronized public void receive(ReceiveRequest messages[]) throws Exception
{
checkSocket();
out.writeByte(m_receive);
1.6 +5 -5
spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverUILClient.java
Index: ConnectionReceiverUILClient.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/ConnectionReceiverUILClient.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ConnectionReceiverUILClient.java 2000/12/23 15:48:21 1.5
+++ ConnectionReceiverUILClient.java 2000/12/26 04:15:56 1.6
@@ -31,7 +31,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
import org.spydermq.multiplexor.SocketMultiplexor;
import org.spydermq.ReceiveRequest;
@@ -46,7 +46,7 @@
static final int m_deleteTemporaryDestination = 1;
static final int m_receive = 3;
- void createConnection() throws RemoteException
+ protected void createConnection() throws RemoteException
{
try {
in=new ObjectInputStream(new
BufferedInputStream(mSocket.getInputStream(2)));
@@ -58,7 +58,7 @@
}
}
- public void waitAnswer() throws Exception
+ protected void waitAnswer() throws Exception
{
Exception throwException=null;
try {
@@ -84,7 +84,7 @@
throw throwException;
}
- public void deleteTemporaryDestination(SpyDestination dest) throws Exception
+ synchronized public void deleteTemporaryDestination(SpyDestination dest)
throws Exception
{
checkSocket();
out.writeByte(m_deleteTemporaryDestination);
@@ -92,7 +92,7 @@
waitAnswer();
}
- public void close() throws Exception
+ synchronized public void close() throws Exception
{
checkSocket();
out.writeByte(m_close);
@@ -108,7 +108,7 @@
createConnection();
}
- public void receive(ReceiveRequest messages[]) throws Exception
+ synchronized public void receive(ReceiveRequest messages[]) throws Exception
{
checkSocket();
out.writeByte(m_receive);
1.10 +3 -0
spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerOIL.java
Index: DistributedJMSServerOIL.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerOIL.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DistributedJMSServerOIL.java 2000/12/23 15:48:21 1.9
+++ DistributedJMSServerOIL.java 2000/12/26 04:15:58 1.10
@@ -39,7 +39,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
*/
public class DistributedJMSServerOIL extends DistributedJMSServerUIL
implements DistributedJMSServerOILMBean
@@ -142,6 +142,9 @@
break;
case m_unsubscribe:
server.unsubscribe(spyDistributedConnection,in.readInt());
+ break;
+ case m_checkUser:
+ result =
server.checkUser((String)in.readObject(), (String)in.readObject());
break;
default:
throw new RemoteException("Bad method
code !");
1.7 +0 -0
spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerOILClient.java
Index: DistributedJMSServerOILClient.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerOILClient.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DistributedJMSServerOILClient.java 2000/12/23 15:48:21 1.6
+++ DistributedJMSServerOILClient.java 2000/12/26 04:15:58 1.7
@@ -38,7 +38,7 @@
*@author Norbert Lataille ([EMAIL PROTECTED])
*@author Hiram Chirino ([EMAIL PROTECTED])
*
- *@version $Revision: 1.6 $
+ *@version $Revision: 1.7 $
*/
public class DistributedJMSServerOILClient extends DistributedJMSServerUILClient
implements DistributedJMSServer, Serializable {
1.6 +2 -0
spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerRMI.java
Index: DistributedJMSServerRMI.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerRMI.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DistributedJMSServerRMI.java 2000/12/23 15:48:21 1.5
+++ DistributedJMSServerRMI.java 2000/12/26 04:15:58 1.6
@@ -28,7 +28,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public interface DistributedJMSServerRMI extends DistributedJMSServer, Remote {
@@ -51,4 +51,6 @@
public void setEnabled(SpyDistributedConnection dc, boolean enabled) throws
RemoteException, Exception;
public void subscribe(SpyDistributedConnection dc, org.spydermq.Subscription
s) throws RemoteException, Exception;
public void unsubscribe(SpyDistributedConnection dc, int subscriptionId )
throws RemoteException, Exception;
+ public String checkUser(String userName, String password) throws JMSException,
RemoteException;
+
}
1.8 +4 -0
spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerRMIImpl.java
Index: DistributedJMSServerRMIImpl.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerRMIImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DistributedJMSServerRMIImpl.java 2000/12/23 15:48:21 1.7
+++ DistributedJMSServerRMIImpl.java 2000/12/26 04:15:58 1.8
@@ -32,7 +32,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class DistributedJMSServerRMIImpl
extends UnicastRemoteObject
@@ -143,5 +143,9 @@
public void unsubscribe(SpyDistributedConnection dc, int subscriptionId )
throws Exception{
server.unsubscribe(dc, subscriptionId);
+ }
+
+ public String checkUser(String userName, String password) throws JMSException {
+ return server.checkUser(userName, password);
}
}
1.8 +4 -0
spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerUIL.java
Index: DistributedJMSServerUIL.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerUIL.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DistributedJMSServerUIL.java 2000/12/23 15:48:21 1.7
+++ DistributedJMSServerUIL.java 2000/12/26 04:15:58 1.8
@@ -41,7 +41,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class DistributedJMSServerUIL
implements Runnable, DistributedJMSServerSetup, DistributedJMSServerUILMBean
@@ -64,6 +64,7 @@
static final int m_subscribe = 16;
static final int m_transact = 17;
static final int m_unsubscribe = 18;
+ static final int m_checkUser = 19;
//The server implementation
protected static JMSServer server;
@@ -188,6 +189,9 @@
break;
case m_unsubscribe:
server.unsubscribe(spyDistributedConnection,in.readInt());
+ break;
+ case m_checkUser:
+ result =
server.checkUser((String)in.readObject(), (String)in.readObject());
break;
default:
throw new RemoteException("Bad method
code !");
1.7 +33 -21
spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerUILClient.java
Index: DistributedJMSServerUILClient.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedJMSServerUILClient.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DistributedJMSServerUILClient.java 2000/12/23 15:48:21 1.6
+++ DistributedJMSServerUILClient.java 2000/12/26 04:15:58 1.7
@@ -17,8 +17,6 @@
import org.spydermq.SpyDestination;
import org.spydermq.Log;
import org.spydermq.SpyDistributedConnection;
-
-
import org.spydermq.server.JMSServer;
import org.spydermq.distributed.interfaces.DistributedJMSServer;
import org.spydermq.multiplexor.SocketMultiplexor;
@@ -42,7 +40,7 @@
*@author Norbert Lataille ([EMAIL PROTECTED])
*@author Hiram Chirino ([EMAIL PROTECTED])
*
- *@version $Revision: 1.6 $
+ *@version $Revision: 1.7 $
*/
public class DistributedJMSServerUILClient implements DistributedJMSServer,
Serializable {
@@ -64,6 +62,8 @@
static final int m_subscribe = 16;
static final int m_transact = 17;
static final int m_unsubscribe = 18;
+ static final int m_checkUser = 19;
+
//Remote stuff
protected int port;
@@ -90,7 +90,7 @@
}
}
- public Object waitAnswer() throws RemoteException {
+ protected Object waitAnswer() throws RemoteException {
try {
out.reset();
out.flush();
@@ -117,7 +117,7 @@
throw new RemoteException("Cannot contact the remote object");
}
- public String getID() throws Exception {
+ synchronized public String getID() throws Exception {
checkConnection();
try {
out.writeByte(m_getID);
@@ -127,7 +127,7 @@
return (String) waitAnswer();
}
- public void checkID(String ID) throws JMSException, RemoteException {
+ synchronized public void checkID(String ID) throws JMSException,
RemoteException {
checkConnection();
try {
out.writeByte(m_checkID);
@@ -138,7 +138,7 @@
waitAnswer();
}
- public void setSpyDistributedConnection(SpyDistributedConnection dest) throws
RemoteException {
+ synchronized public void setSpyDistributedConnection(SpyDistributedConnection
dest) throws RemoteException {
checkConnection();
try {
out.writeByte(m_setSpyDistributedConnection);
@@ -149,7 +149,7 @@
waitAnswer();
}
- public void connectionClosing(SpyDistributedConnection dc) throws
JMSException, RemoteException {
+ synchronized public void connectionClosing(SpyDistributedConnection dc) throws
JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_connectionClosing);
@@ -159,7 +159,7 @@
waitAnswer();
}
- public TemporaryQueue getTemporaryQueue(SpyDistributedConnection dc) throws
JMSException, RemoteException {
+ synchronized public TemporaryQueue getTemporaryQueue(SpyDistributedConnection
dc) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_getTemporaryQueue);
@@ -169,7 +169,7 @@
return (TemporaryQueue) waitAnswer();
}
- public TemporaryTopic getTemporaryTopic(SpyDistributedConnection dc) throws
JMSException, RemoteException {
+ synchronized public TemporaryTopic getTemporaryTopic(SpyDistributedConnection
dc) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_getTemporaryTopic);
@@ -179,7 +179,7 @@
return (TemporaryTopic) waitAnswer();
}
- public void acknowledge(SpyDistributedConnection dc, AcknowledgementRequest
item) throws JMSException, RemoteException {
+ synchronized public void acknowledge(SpyDistributedConnection dc,
AcknowledgementRequest item) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_acknowledge);
@@ -190,7 +190,7 @@
waitAnswer();
}
- public void addMessage(SpyDistributedConnection dc, SpyMessage val) throws
JMSException, RemoteException {
+ synchronized public void addMessage(SpyDistributedConnection dc, SpyMessage
val) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_addMessage);
@@ -206,7 +206,7 @@
createConnection();
}
- public void listenerChange(SpyDistributedConnection dc, int subscriberId,
boolean state) throws Exception, RemoteException {
+ synchronized public void listenerChange(SpyDistributedConnection dc, int
subscriberId, boolean state) throws Exception, RemoteException {
checkConnection();
try {
out.writeByte(m_listenerChange);
@@ -218,7 +218,7 @@
waitAnswer();
}
- public Queue createQueue(SpyDistributedConnection dc, String dest) throws
JMSException, RemoteException {
+ synchronized public Queue createQueue(SpyDistributedConnection dc, String
dest) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_createQueue);
@@ -229,7 +229,7 @@
return (Queue) waitAnswer();
}
- public Topic createTopic(SpyDistributedConnection dc, String dest) throws
JMSException, RemoteException {
+ synchronized public Topic createTopic(SpyDistributedConnection dc, String
dest) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_createTopic);
@@ -240,7 +240,7 @@
return (Topic) waitAnswer();
}
- public void deleteTemporaryDestination(SpyDistributedConnection dc,
SpyDestination dest) throws JMSException, RemoteException {
+ synchronized public void deleteTemporaryDestination(SpyDistributedConnection
dc, SpyDestination dest) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_deleteTemporaryDestination);
@@ -251,7 +251,7 @@
waitAnswer();
}
- public SpyMessage receive(SpyDistributedConnection dc, int subscriberId, long
wait) throws Exception, RemoteException {
+ synchronized public SpyMessage receive(SpyDistributedConnection dc, int
subscriberId, long wait) throws Exception, RemoteException {
checkConnection();
try {
out.writeByte(m_receive);
@@ -263,7 +263,7 @@
return (SpyMessage) waitAnswer();
}
- public void subscribe(SpyDistributedConnection dc, org.spydermq.Subscription
s) throws JMSException, RemoteException {
+ synchronized public void subscribe(SpyDistributedConnection dc,
org.spydermq.Subscription s) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_subscribe);
@@ -275,7 +275,7 @@
}
- public void unsubscribe(SpyDistributedConnection dc, int subscriptionId )
throws JMSException, RemoteException {
+ synchronized public void unsubscribe(SpyDistributedConnection dc, int
subscriptionId ) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_unsubscribe);
@@ -286,7 +286,7 @@
waitAnswer();
}
- public void setEnabled(SpyDistributedConnection dc, boolean enabled) throws
JMSException, RemoteException {
+ synchronized public void setEnabled(SpyDistributedConnection dc, boolean
enabled) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_setEnabled);
@@ -297,7 +297,7 @@
waitAnswer();
}
- public SpyMessage[] browse(SpyDistributedConnection dc, Destination dest,
String selector) throws JMSException, RemoteException {
+ synchronized public SpyMessage[] browse(SpyDistributedConnection dc,
Destination dest, String selector) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_browse);
@@ -309,7 +309,7 @@
return (SpyMessage[]) waitAnswer();
}
- public void transact(org.spydermq.SpyDistributedConnection dc,
TransactionRequest t) throws JMSException, RemoteException {
+ synchronized public void transact(org.spydermq.SpyDistributedConnection dc,
TransactionRequest t) throws JMSException, RemoteException {
checkConnection();
try {
out.writeByte(m_transact);
@@ -318,5 +318,17 @@
failure(e);
}
waitAnswer();
+ }
+
+ synchronized public String checkUser(String userName, String password) throws
JMSException, RemoteException {
+ checkConnection();
+ try {
+ out.writeByte(m_checkUser);
+ out.writeObject(userName);
+ out.writeObject(password);
+ } catch (IOException e) {
+ failure(e);
+ }
+ return (String)waitAnswer();
}
}