User: hiram
Date: 00/12/25 20:16:01
Modified: src/java/org/spydermq/server InvocationLayerFactory.java
JMSServer.java StartServer.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.3 +5 -6
spyderMQ/src/java/org/spydermq/server/InvocationLayerFactory.java
Index: InvocationLayerFactory.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/server/InvocationLayerFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- InvocationLayerFactory.java 2000/12/19 06:43:36 1.2
+++ InvocationLayerFactory.java 2000/12/26 04:16:00 1.3
@@ -17,20 +17,20 @@
import org.spydermq.distributed.interfaces.DistributedConnectionFactory;
import org.spydermq.distributed.interfaces.DistributedJMSServerSetup;
import org.spydermq.distributed.interfaces.DistributedJMSServer;
+import org.spydermq.SpyXAQueueConnectionFactory;
+import org.spydermq.SpyXATopicConnectionFactory;
import java.util.Properties;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.Remote;
-import org.spydermq.SpyXAQueueConnectionFactory;
-import org.spydermq.SpyXATopicConnectionFactory;
public class InvocationLayerFactory
{
// Set these attributes before the createObjects() call
String connectionReceiverClassName;
- String distributedConnectionFactoryClassName;
+
String distributedJMSServerClassName;
// These will be set after the createObjects() call
@@ -43,7 +43,7 @@
public void createObjects(JMSServer s) throws Exception
{
//Get the Topic properties
- if (distributedJMSServerClassName == null ||
distributedConnectionFactoryClassName == null || connectionReceiverClassName==null ) {
+ if (distributedJMSServerClassName == null ||
connectionReceiverClassName==null ) {
throw new RuntimeException("Missing configuration parameters");
}
@@ -52,9 +52,8 @@
distributedJMSServer = distributedJMSServerSetup.createClient();
//Create the distributedTopicConnectionFactory object
- distributedConnectionFactory =
(DistributedConnectionFactory)Class.forName(distributedConnectionFactoryClassName).newInstance();
+ distributedConnectionFactory = new DistributedConnectionFactory();
distributedConnectionFactory.setServer(distributedJMSServer);
-
distributedConnectionFactory.setSecurityManager(s.getSecurityManager());
distributedConnectionFactory.setConnectionReceiverClassName(connectionReceiverClassName);
//Create the Topic and Queue Connection Factory objects
1.7 +15 -8 spyderMQ/src/java/org/spydermq/server/JMSServer.java
Index: JMSServer.java
===================================================================
RCS file: /products/cvs/ejboss/spyderMQ/src/java/org/spydermq/server/JMSServer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JMSServer.java 2000/12/24 01:55:07 1.6
+++ JMSServer.java 2000/12/26 04:16:00 1.7
@@ -18,8 +18,8 @@
import java.util.Iterator;
import org.spydermq.*;
-import org.spydermq.security.SecurityManager;
import org.spydermq.xml.XElement;
+import org.spydermq.security.UserManager;
/**
* This class implements the JMS provider
@@ -27,7 +27,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class JMSServer
implements Runnable, JMSServerMBean
@@ -49,7 +49,7 @@
//last id given to a temporary queue
private int lastTemporaryQueue;
//The security manager
- SecurityManager securityManager;
+ UserManager userManager;
//The persistence manager
PersistenceManager persistenceManager;
@@ -210,7 +210,7 @@
while (true) {
try {
ID="ID"+(new Integer(lastID++).toString());
- securityManager.addClientID(ID);
+ userManager.addClientID(ID);
break;
} catch (Exception e) {
}
@@ -256,7 +256,7 @@
public void checkID(String ID) throws JMSException
{
- securityManager.addClientID(ID);
+ userManager.addClientID(ID);
}
//A connection has sent a new message
@@ -265,9 +265,7 @@
addMessage( dc, val, null);
}
- public org.spydermq.security.SecurityManager getSecurityManager() {
- return securityManager;
- }
+
//A connection has sent a new message
public void addMessage(SpyDistributedConnection dc, SpyMessage val, Long txId)
throws JMSException
@@ -378,7 +376,7 @@
//unregister its clientID
if (dc.getClientID()!=null)
- securityManager.removeID(dc.getClientID());
+ userManager.removeID(dc.getClientID());
//Remove any temporary destinations the consumer may have created.
synchronized (messageQueue) {
@@ -513,4 +511,13 @@
stream.close();
}
+
+ public UserManager getUserManager() {
+ return userManager;
+ }
+
+ public String checkUser(String userName, String password) throws JMSException {
+ return userManager.checkUser(userName, password);
+ }
+
}
1.9 +7 -9 spyderMQ/src/java/org/spydermq/server/StartServer.java
Index: StartServer.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/server/StartServer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StartServer.java 2000/12/24 02:34:47 1.8
+++ StartServer.java 2000/12/26 04:16:00 1.9
@@ -28,7 +28,6 @@
import java.util.LinkedList;
import java.util.Iterator;
-import org.spydermq.security.SecurityManager;
import org.spydermq.distributed.interfaces.DistributedJMSServer;
import org.spydermq.distributed.interfaces.DistributedJMSServerSetup;
import org.spydermq.SpyQueueConnectionFactory;
@@ -37,6 +36,7 @@
import org.spydermq.SpyTopicConnectionFactory;
import org.spydermq.xml.XElement;
import org.spydermq.persistence.SpyTxLog;
+import org.spydermq.security.UserManager;
/**
* Class used to start a JMS service. This can be called from inside another
@@ -48,15 +48,15 @@
* @author Vincent Sheffer ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class StartServer implements Runnable
{
private JMSServer theServer;
private MBeanServer mBeanServer;
private LinkedList serviceList = new LinkedList();
- SecurityManager securityManager;
+
/**
* Start the JMS server running in it's own thread.
*
@@ -162,9 +162,9 @@
theServer.serverConfig = serverCfg;
- //Create a SecurityManager object
- securityManager=new SecurityManager();
- theServer.securityManager = securityManager;
+ //Create a UserManager object
+ UserManager userManager=new UserManager();
+ theServer.userManager = userManager;
PersistenceManager persistenceManager = new
PersistenceManager(theServer, serverCfg.getElement("PersistenceManager"));
theServer.persistenceManager = persistenceManager;
@@ -204,9 +204,9 @@
String name = element.getField("Name");
String passwd = element.getField("Password");
if( element.containsField("Id") ) {
-
securityManager.addUser(name,passwd,element.getField("Id"));
+
userManager.addUser(name,passwd,element.getField("Id"));
} else {
- securityManager.addUser(name,passwd,null);
+ userManager.addUser(name,passwd,null);
}
}
@@ -227,7 +227,6 @@
InvocationLayerFactory invocationLayerFactory= new
InvocationLayerFactory();
invocationLayerFactory.distributedJMSServerClassName =
element.getField("ServerClass");
invocationLayerFactory.connectionReceiverClassName =
element.getField("ReceiverClass");
-
invocationLayerFactory.distributedConnectionFactoryClassName =
element.getField("ConnectionFactoryClass");
invocationLayerFactory.createObjects(theServer);
@@ -258,5 +257,4 @@
}
}
- SpyTxLog spyTxManager;
}