[jboss-cvs] JBoss Messaging SVN: r3413 - branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Dec 5 14:42:55 EST 2007


Author: timfox
Date: 2007-12-05 14:42:55 -0500 (Wed, 05 Dec 2007)
New Revision: 3413

Added:
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Consumer.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/DistributionPolicy.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Filter.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/HandleStatus.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PagingManager.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PersistenceManager.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Queue.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Transaction.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionStore.java
   branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionSynchronization.java
Log:
added missing files


Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Consumer.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Consumer.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Consumer.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,35 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.messaging.newcore.intf;
+
+
+/**
+ * 
+ * A Consumer
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface Consumer
+{
+   HandleStatus handle(MessageReference reference);
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/DistributionPolicy.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/DistributionPolicy.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/DistributionPolicy.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,36 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.messaging.newcore.intf;
+
+import java.util.List;
+
+/**
+ * 
+ * A DistributionPolicy
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface DistributionPolicy
+{
+   int select(List<Consumer> consumers, int lastPos);
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Filter.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Filter.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Filter.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.messaging.newcore.intf;
+
+/**
+ * 
+ * A Filter
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface Filter
+{
+   boolean match(Message message);
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/HandleStatus.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/HandleStatus.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/HandleStatus.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,40 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.messaging.newcore.intf;
+
+/**
+ * 
+ * A HandleStatus
+ * 
+ * HANDLED means the MessageReference was handled
+ * 
+ * NO_MATCH means the MessageReference was rejected by a Filter
+ * 
+ * BUSY means the MessageReference was rejected since the Consumer was busy
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public enum HandleStatus
+{
+   HANDLED, NO_MATCH, BUSY;
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PagingManager.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PagingManager.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PagingManager.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,15 @@
+package org.jboss.messaging.newcore.intf;
+
+/**
+ * 
+ * A PagingManager
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface PagingManager extends MessagingComponent
+{
+   void pageReference(Queue queue, MessageReference ref);
+   
+   MessageReference depageReference(Queue queue);
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PersistenceManager.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PersistenceManager.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/PersistenceManager.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,129 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.messaging.newcore.intf;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.transaction.xa.Xid;
+
+/**
+ * 
+ * A PersistenceManager
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface PersistenceManager extends MessagingComponent
+{
+   /**
+    * A single message, possible with many message references needs to be added to storage
+    * This would occur when a single reliable messages arrives on the server and needs to be routed
+    * to 1 or more queues.
+    * @param message
+    */
+   public void commitMessage(Message message) throws Exception;
+   
+   /**
+    * Multiple messages, each potentially with multiple message references needs to be added to storage
+    * This would occur when a 1 PC transaction containing many messages arrives on the server and they need to be routed
+    * to 1 or more queues.
+    * @param messages
+    */
+   public void commitMessages(List<Message> messages) throws Exception;
+   
+   /**
+    * Multiple messages, each potentially with multiple message references needs to be added to storage
+    * in prepared state - used for XA functionality
+    * This would occur when a 2 PC transaction containing many messages arrives on the server and they need to routed
+    * to 1 or more queues, but prepared first
+    * @param xid - the Xid of the transaction
+    * @param messages
+    */
+   public void prepareMessages(Xid xid, List<Message> messages) throws Exception;
+   
+   /**
+    * Unprepare a List of messages - each with potentially many message references
+    * This would occur when a 2 PC transaction rolls back
+    * @param xid - the Xid of the transaction
+    * @param messages
+    */
+   public void unprepareMessages(Xid xid, List<Message> messages) throws Exception;
+   
+   /**
+    * Commit a prepared transaction
+    * 
+    * @param xid
+    * @throws Exception
+    */
+   public void commitPreparedMessages(Xid xid) throws Exception;
+   
+   /**
+    * Delete a single reference. This would also delete the message if it is no longer referenced by any other
+    * references.
+    * This would occur on acknowledgement of a single reference
+    * @param message
+    */
+   void deleteReference(MessageReference reference) throws Exception;
+   
+   /**
+    * Delete a list of references from storage, also deleting their corresponding messages if they are no longer
+    * referenced.
+    * This would occur on acknowledgement of multiple references in a transaction.
+    * @param messages
+    */
+   void deleteReferences(List<MessageReference> references) throws Exception;
+   
+   /**
+    * Update the delivery count of a reference
+    * @param queue
+    * @param ref
+    * @throws Exception
+    */
+   void updateDeliveryCount(Queue queue, MessageReference ref) throws Exception;
+   
+   /**
+    * Load the specified queues from persistent storage
+    * @param queues The map of queues to load
+    * @throws Exception
+    */
+   void loadQueues(Map<Long, Queue> queues) throws Exception;
+      
+   /**
+    * Get a list of in doubt (prepared) transaction ids
+    * Can only be called in recovery mode
+    * @return the list of ids
+    */
+   List<Xid> getInDoubtXids() throws Exception;
+   
+   /**
+    * 
+    * @return true if the PersistenceManager is in recovery mode
+    */
+   boolean isInRecoveryMode() throws Exception;
+   
+   /**
+    * 
+    * @param recoveryMode Set the PersistenceManager in recovery mode
+    */
+   void setInRecoveryMode(boolean recoveryMode);
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Queue.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Queue.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Queue.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,73 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.messaging.newcore.intf;
+
+import java.util.List;
+
+
+/**
+ * 
+ * A Queue
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface Queue
+{
+   public static final int NUM_PRIORITIES = 10;
+      
+   HandleStatus addLast(MessageReference ref);
+   
+   HandleStatus addFirst(MessageReference ref);
+   
+   void deliver();
+   
+   void addConsumer(Consumer consumer);
+
+   boolean removeConsumer(Consumer consumer);
+   
+   int getConsumerCount();
+   
+   List<MessageReference> list(Filter filter);
+   
+   void removeAllReferences();
+   
+   long getID();
+   
+   Filter getFilter();
+   
+   void setFilter(Filter filter);
+   
+   int getMessageCount();
+   
+   //int getDeliveringCount();
+   
+   int getScheduledCount();
+     
+   int getMaxSize();
+   
+   void setMaxSize(int maxSize);
+   
+   DistributionPolicy getDistributionPolicy();
+   
+   void setDistributionPolicy(DistributionPolicy policy);
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Transaction.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Transaction.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/Transaction.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.messaging.newcore.intf;
+
+/**
+ * 
+ * A Transaction
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface Transaction
+{   
+   void addSynchronization(TransactionSynchronization sync);
+   
+   void prepare(PersistenceManager persistenceManager) throws Exception;
+   
+   void commit(PersistenceManager persistenceManager) throws Exception;
+   
+   void rollback(PersistenceManager persistenceManager) throws Exception;   
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionStore.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionStore.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionStore.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,36 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.messaging.newcore.intf;
+
+/**
+ * 
+ * A TransactionStore
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface TransactionStore extends MessagingComponent
+{
+   Transaction getTransaction(Object id);
+   
+   void putTransaction(Transaction tx);      
+}

Added: branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionSynchronization.java
===================================================================
--- branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionSynchronization.java	                        (rev 0)
+++ branches/Branch_New_Persistence/src/main/org/jboss/messaging/newcore/intf/TransactionSynchronization.java	2007-12-05 19:42:55 UTC (rev 3413)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.messaging.newcore.intf;
+
+/**
+ * 
+ * A TransactionSynchronization
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface TransactionSynchronization
+{
+   void beforeCommit() throws Exception;
+   
+   void afterCommit() throws Exception;
+   
+   void beforeRollback() throws Exception;
+   
+   void afterRollback() throws Exception;
+}




More information about the jboss-cvs-commits mailing list