User: hiram
Date: 00/12/18 22:43:38
Modified: src/java/org/spydermq/distributed/server
DistributedJMSServerUILClient.java
DistributedJMSServerUIL.java
DistributedJMSServerRMIImpl.java
DistributedJMSServerRMI.java
DistributedJMSServerOIL.java
DistributedConnectionFactoryRMIImpl.java
DistributedConnectionFactoryRMI.java
Log:
Add XA support! Well.. I haven't tested very much but it's a start.
Revision Changes Path
1.5 +12 -8
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DistributedJMSServerUILClient.java 2000/12/12 05:58:52 1.4
+++ DistributedJMSServerUILClient.java 2000/12/19 06:43:37 1.5
@@ -18,7 +18,7 @@
import org.spydermq.Log;
import org.spydermq.SpyDistributedConnection;
import org.spydermq.SpyAcknowledgementItem;
-import org.spydermq.Transaction;
+
import org.spydermq.server.JMSServer;
import org.spydermq.distributed.interfaces.DistributedJMSServer;
import org.spydermq.multiplexor.SocketMultiplexor;
@@ -33,13 +33,15 @@
import java.net.Socket;
import java.net.InetAddress;
+import org.spydermq.TransactionRequest;
+
/**
*The UIL implementation of the DistributedJMSServer object
*
*@author Norbert Lataille ([EMAIL PROTECTED])
*@author Hiram Chirino ([EMAIL PROTECTED])
*
- *@version $Revision: 1.4 $
+ *@version $Revision: 1.5 $
*/
public class DistributedJMSServerUILClient implements DistributedJMSServer,
Serializable {
@@ -268,23 +270,25 @@
}
waitAnswer();
}
+
+
- public void transact(org.spydermq.SpyDistributedConnection dc, Transaction t)
throws JMSException, RemoteException {
+ public void unsubscribe(SpyDistributedConnection dc, Destination dest) throws
JMSException, RemoteException {
checkConnection();
try {
- out.writeByte(Transact);
- out.writeObject(t);
+ out.writeByte(Unsubscribe);
+ out.writeObject(dest);
} catch (IOException e) {
failure(e);
}
waitAnswer();
}
- public void unsubscribe(SpyDistributedConnection dc, Destination dest) throws
JMSException, RemoteException {
+ public void transact(org.spydermq.SpyDistributedConnection dc,
TransactionRequest t) throws JMSException, RemoteException {
checkConnection();
try {
- out.writeByte(Unsubscribe);
- out.writeObject(dest);
+ out.writeByte(Transact);
+ out.writeObject(t);
} catch (IOException e) {
failure(e);
}
1.6 +5 -3
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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DistributedJMSServerUIL.java 2000/12/12 05:58:51 1.5
+++ DistributedJMSServerUIL.java 2000/12/19 06:43:37 1.6
@@ -19,7 +19,7 @@
import org.spydermq.Log;
import org.spydermq.SpyAcknowledgementItem;
import org.spydermq.server.JMSServer;
-import org.spydermq.Transaction;
+
import org.spydermq.distributed.interfaces.DistributedJMSServer;
import org.spydermq.distributed.interfaces.DistributedJMSServerSetup;
import org.spydermq.multiplexor.SocketMultiplexor;
@@ -34,13 +34,15 @@
import java.io.BufferedInputStream;
import java.io.IOException;
+import org.spydermq.TransactionRequest;
+
/**
* The UIL implementation of the DistributedJMSServer object
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class DistributedJMSServerUIL
implements Runnable, DistributedJMSServerSetup, DistributedJMSServerUILMBean
@@ -183,7 +185,7 @@
}
break;
case Transact:
-
server.transact(spyDistributedConnection, (Transaction)in.readObject());
+
server.transact(spyDistributedConnection, (TransactionRequest)in.readObject());
break;
default:
throw new RemoteException("Bad method
code !");
1.6 +16 -5
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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DistributedJMSServerRMIImpl.java 2000/12/12 05:58:50 1.5
+++ DistributedJMSServerRMIImpl.java 2000/12/19 06:43:37 1.6
@@ -12,19 +12,29 @@
import javax.jms.Queue;
import javax.jms.TemporaryTopic;
import javax.jms.TemporaryQueue;
+
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
+
import org.spydermq.SpyMessage;
import org.spydermq.SpyDestination;
-
import org.spydermq.SpyDistributedConnection;
import org.spydermq.Log;
import org.spydermq.distributed.interfaces.DistributedJMSServer;
import org.spydermq.distributed.interfaces.DistributedJMSServerSetup;
import org.spydermq.SpyAcknowledgementItem;
-
import org.spydermq.server.JMSServer;
-import org.spydermq.Transaction;public class DistributedJMSServerRMIImpl
+import org.spydermq.TransactionRequest;
+
+/**
+ * The RMI implementation of the DistributedJMSServer object
+ *
+ * @author Norbert Lataille ([EMAIL PROTECTED])
+ * @author Hiram Chirino ([EMAIL PROTECTED])
+ *
+ * @version $Revision: 1.6 $
+ */
+public class DistributedJMSServerRMIImpl
extends UnicastRemoteObject
implements DistributedJMSServerRMI, DistributedJMSServerRMIImplMBean,
DistributedJMSServerSetup
{
@@ -127,6 +137,7 @@
server.unsubscribe(dc,dest);
}
- public void transact(org.spydermq.SpyDistributedConnection dc, Transaction t)
throws JMSException {
+ public void transact(org.spydermq.SpyDistributedConnection dc,
TransactionRequest t) throws JMSException {
server.transact(dc,t);
- }}
+ }
+}
1.4 +9 -4
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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DistributedJMSServerRMI.java 2000/12/12 05:58:51 1.3
+++ DistributedJMSServerRMI.java 2000/12/19 06:43:37 1.4
@@ -5,25 +5,30 @@
* See terms of license at gnu.org.
*/
package org.spydermq.distributed.server;
+
import javax.jms.JMSException;
import javax.jms.Destination;
import javax.jms.Topic;
import javax.jms.Queue;
import javax.jms.TemporaryTopic;
import javax.jms.TemporaryQueue;
+
import java.rmi.Remote;
import java.rmi.RemoteException;
+
import org.spydermq.SpyMessage;
import org.spydermq.SpyDestination;
import org.spydermq.SpyDistributedConnection;
import org.spydermq.distributed.interfaces.DistributedJMSServer;
import org.spydermq.SpyAcknowledgementItem;
+
/**
- *The RMI interface of the DistributedJMSServer object
+ * The RMI interface of the DistributedJMSServer object
*
- *@author Norbert Lataille ([EMAIL PROTECTED])
+ * @author Norbert Lataille ([EMAIL PROTECTED])
+ * @author Hiram Chirino ([EMAIL PROTECTED])
*
- *@version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public interface DistributedJMSServerRMI extends DistributedJMSServer, Remote {
// Public --------------------------------------------------------
@@ -41,6 +46,6 @@
public void deleteTemporaryDestination(SpyDistributedConnection dc,
SpyDestination dest) throws RemoteException, Exception;
public SpyMessage queueReceive(SpyDistributedConnection dc, Queue queue, long
wait) throws RemoteException, Exception;
public void subscribe(SpyDistributedConnection dc, Destination dest) throws
RemoteException, Exception;
- public void transact(SpyDistributedConnection dc, org.spydermq.Transaction t)
throws RemoteException, Exception;
public void unsubscribe(SpyDistributedConnection dc, Destination dest) throws
RemoteException, Exception;
+ public void transact(SpyDistributedConnection dc,
org.spydermq.TransactionRequest t) throws RemoteException, Exception;
}
1.8 +6 -4
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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DistributedJMSServerOIL.java 2000/12/12 05:58:52 1.7
+++ DistributedJMSServerOIL.java 2000/12/19 06:43:37 1.8
@@ -20,8 +20,8 @@
import org.spydermq.SpyAcknowledgementItem;
import org.spydermq.distributed.interfaces.DistributedJMSServer;
import org.spydermq.distributed.interfaces.DistributedJMSServerSetup;
-import org.spydermq.Transaction;
+
import java.rmi.RemoteException;
import java.net.ServerSocket;
import java.net.Socket;
@@ -32,13 +32,15 @@
import java.io.BufferedInputStream;
import java.io.IOException;
+import org.spydermq.TransactionRequest;
+
/**
* The OIL implementation of the DistributedJMSServer object
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class DistributedJMSServerOIL extends DistributedJMSServerUIL
implements DistributedJMSServerOILMBean
@@ -133,8 +135,8 @@
case SetSpyDistributedConnection:
spyDistributedConnection =
(SpyDistributedConnection)in.readObject();
break;
- case Transact:
-
server.transact(spyDistributedConnection, (Transaction)in.readObject());
+ case Transact:
+
server.transact(spyDistributedConnection, (TransactionRequest)in.readObject());
break;
default:
throw new RemoteException("Bad method
code !");
1.2 +38 -7
spyderMQ/src/java/org/spydermq/distributed/server/DistributedConnectionFactoryRMIImpl.java
Index: DistributedConnectionFactoryRMIImpl.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedConnectionFactoryRMIImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DistributedConnectionFactoryRMIImpl.java 2000/12/12 05:58:51 1.1
+++ DistributedConnectionFactoryRMIImpl.java 2000/12/19 06:43:37 1.2
@@ -21,13 +21,18 @@
import org.spydermq.server.JMSServer;
import javax.jms.TopicConnection;
+import javax.jms.XAQueueConnection;
+import org.spydermq.SpyXATopicConnection;
+import javax.jms.XATopicConnection;
+import org.spydermq.SpyXAQueueConnection;
+
/**
* The RMI implementation of the DistributedConnectionFactory object
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class DistributedConnectionFactoryRMIImpl
extends UnicastRemoteObject
@@ -65,8 +70,7 @@
public QueueConnection createQueueConnection() throws JMSException
{
- SpyQueueConnection obj=new SpyQueueConnection(server,null,crCN);
- return obj;
+ return new SpyQueueConnection(server,null,crCN);
}
public QueueConnection createQueueConnection(String userName, String password)
throws JMSException
@@ -77,15 +81,13 @@
public TopicConnection createTopicConnection() throws JMSException
{
- SpyTopicConnection obj=new SpyTopicConnection(server,null,crCN);
- return obj;
+ return new SpyTopicConnection(server,null,crCN);
}
public TopicConnection createTopicConnection(String userName, String password)
throws JMSException
{
String id=securityManager.checkUser(userName,password);
- SpyTopicConnection obj=new SpyTopicConnection(server,id,crCN);
- return obj;
+ return new SpyTopicConnection(server,id,crCN);
}
public void setConnectionReceiverClassName(String className)
@@ -93,4 +95,33 @@
crCN=className;
}
+ /**
+ * createXAQueueConnection method comment.
+ */
+ public javax.jms.XAQueueConnection createXAQueueConnection() throws
java.lang.Exception {
+ return new SpyXAQueueConnection(server,null,crCN);
+ }
+
+ /**
+ * createXAQueueConnection method comment.
+ */
+ public javax.jms.XAQueueConnection createXAQueueConnection(java.lang.String
userName, java.lang.String password) throws java.lang.Exception {
+ String id=securityManager.checkUser(userName,password);
+ return new SpyXAQueueConnection(server,id,crCN);
+ }
+
+ /**
+ * createXATopicConnection method comment.
+ */
+ public javax.jms.XATopicConnection createXATopicConnection() throws
java.lang.Exception {
+ return new SpyXATopicConnection(server,null,crCN);
+ }
+
+ /**
+ * createXATopicConnection method comment.
+ */
+ public javax.jms.XATopicConnection createXATopicConnection(java.lang.String
userName, java.lang.String password) throws java.lang.Exception {
+ String id=securityManager.checkUser(userName,password);
+ return new SpyXATopicConnection(server,id,crCN);
+ }
}
1.2 +9 -2
spyderMQ/src/java/org/spydermq/distributed/server/DistributedConnectionFactoryRMI.java
Index: DistributedConnectionFactoryRMI.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/distributed/server/DistributedConnectionFactoryRMI.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DistributedConnectionFactoryRMI.java 2000/12/12 05:58:50 1.1
+++ DistributedConnectionFactoryRMI.java 2000/12/19 06:43:38 1.2
@@ -14,13 +14,16 @@
import org.spydermq.distributed.interfaces.DistributedConnectionFactory;
+import javax.jms.XAQueueConnection;
+import javax.jms.XATopicConnection;
+
/**
* The RMI interface of the DistributedConnectionFactory object
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public interface DistributedConnectionFactoryRMI extends
DistributedConnectionFactory, Remote
{
@@ -30,5 +33,9 @@
public QueueConnection createQueueConnection(String userName, String password)
throws Exception;
public TopicConnection createTopicConnection() throws Exception;
public TopicConnection createTopicConnection(String userName, String password)
throws Exception;
-
+ public XAQueueConnection createXAQueueConnection() throws Exception;
+ public XAQueueConnection createXAQueueConnection(String userName, String
password) throws Exception;
+ public XATopicConnection createXATopicConnection() throws Exception;
+ public XATopicConnection createXATopicConnection(String userName, String
password) throws Exception;
+
}