User: chirino
Date: 01/08/16 20:04:06
Modified: src/main/org/jboss/mq/referenceable ObjectRefAddr.java
SpyConnectionFactoryObjectFactory.java
SpyDestinationObjectFactory.java
Log:
Used the ejbdoclet pretty task to auto-indent the source files to
the 3 space standard.
Revision Changes Path
1.2 +71 -60 jbossmq/src/main/org/jboss/mq/referenceable/ObjectRefAddr.java
Index: ObjectRefAddr.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/referenceable/ObjectRefAddr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ObjectRefAddr.java 2001/08/11 20:59:15 1.1
+++ ObjectRefAddr.java 2001/08/17 03:04:06 1.2
@@ -5,71 +5,82 @@
* See terms of license at gnu.org.
*/
package org.jboss.mq.referenceable;
-
-import javax.naming.RefAddr;
-
-import java.rmi.MarshalledObject;
-import java.io.ObjectOutputStream;
import java.io.ByteArrayInputStream;
-import java.lang.ref.Reference;
-import java.io.ObjectInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.ref.Reference;
+
+import java.rmi.MarshalledObject;
+import javax.naming.RefAddr;
+
/**
- * This class is used to store a serializable object in
- * a RefAddr object.
- *
- * @author Scott M Stark ([EMAIL PROTECTED])
- * @author Hiram Chirino ([EMAIL PROTECTED])
- *
- * @version $Revision: 1.1 $
+ * This class is used to store a serializable object in a RefAddr object.
+ *
+ * @author Scott M Stark ([EMAIL PROTECTED])
+ * @author Hiram Chirino ([EMAIL PROTECTED])
+ * @created August 16, 2001
+ * @version $Revision: 1.2 $
*/
public class ObjectRefAddr extends RefAddr {
+ private byte[] serialContent;
+
+
+ /**
+ * ObjectRefAddr constructor comment.
+ *
+ * @param arg1 java.lang.String
+ * @param content Description of Parameter
+ * @exception javax.naming.NamingException Description of Exception
+ */
+ public ObjectRefAddr( String arg1, Object content )
+ throws javax.naming.NamingException {
+ super( arg1 );
+
+ try {
+ java.rmi.MarshalledObject mo = new MarshalledObject( content );
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream( baos );
+ oos.writeObject( mo );
+ serialContent = baos.toByteArray();
+ } catch ( java.io.IOException e ) {
+ e.printStackTrace();
+ throw new javax.naming.NamingException( "Could not create a reference: " +
e.getMessage() );
+ }
+ }
+
+ /**
+ * getContent method comment.
+ *
+ * @return The Content value
+ */
+ public Object getContent() {
+ return serialContent;
+ }
+
+ /**
+ * getContent method comment.
+ *
+ * @param ref Description of Parameter
+ * @param arg1 Description of Parameter
+ * @return Description of the Returned
+ * Value
+ * @exception javax.naming.NamingException Description of Exception
+ */
+ public static Object extractObjectRefFrom( javax.naming.Reference ref, String
arg1 )
+ throws javax.naming.NamingException {
+
+ try {
+ byte[] serialContent = ( byte[] )ref.get( arg1 ).getContent();
+ ByteArrayInputStream bais = new ByteArrayInputStream( serialContent );
+ ObjectInputStream ois = new ObjectInputStream( bais );
+ java.rmi.MarshalledObject mo = ( java.rmi.MarshalledObject
)ois.readObject();
+ return mo.get();
+ } catch ( Exception e ) {
+ throw new javax.naming.NamingException( "Invalid reference. Error: " +
e.getMessage() );
+ }
-
- /**
- * ObjectRefAddr constructor comment.
- * @param arg1 java.lang.String
- */
- public ObjectRefAddr(String arg1, Object content) throws
javax.naming.NamingException {
- super(arg1);
-
- try {
- java.rmi.MarshalledObject mo= new MarshalledObject(content);
- ByteArrayOutputStream baos= new ByteArrayOutputStream();
- ObjectOutputStream oos= new ObjectOutputStream(baos);
- oos.writeObject(mo);
- serialContent= baos.toByteArray();
- } catch ( java.io.IOException e ) {
- e.printStackTrace();
- throw new javax.naming.NamingException("Could not create a
reference: "+e.getMessage());
- }
- }
-
- /**
- * getContent method comment.
- */
- public Object getContent() {
- return serialContent;
- }
-
- private byte[] serialContent;
-
- /**
- * getContent method comment.
- */
- static public Object extractObjectRefFrom(javax.naming.Reference ref, String
arg1) throws javax.naming.NamingException {
-
- try {
- byte[] serialContent= (byte[]) ref.get(arg1).getContent();
- ByteArrayInputStream bais= new ByteArrayInputStream(serialContent);
- ObjectInputStream ois = new ObjectInputStream(bais);
- java.rmi.MarshalledObject mo= (java.rmi.MarshalledObject)
ois.readObject();
- return mo.get();
- } catch ( Exception e ) {
- throw new javax.naming.NamingException("Invalid reference.
Error: "+e.getMessage());
- }
-
- }
-}
\ No newline at end of file
+ }
+}
1.2 +43 -48
jbossmq/src/main/org/jboss/mq/referenceable/SpyConnectionFactoryObjectFactory.java
Index: SpyConnectionFactoryObjectFactory.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/referenceable/SpyConnectionFactoryObjectFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SpyConnectionFactoryObjectFactory.java 2001/08/11 20:59:15 1.1
+++ SpyConnectionFactoryObjectFactory.java 2001/08/17 03:04:06 1.2
@@ -8,58 +8,53 @@
import javax.naming.spi.ObjectFactory;
-
-
-
-
-
-
-
-
import org.jboss.mq.GenericConnectionFactory;
/**
- * This class is used to create instances of of:
- * SpyTopicConnectionFactory
- * SpyQueueConnectionFactory
- * SpyXATopicConnectionFactory
- * SpyXAQueueConnectionFactory
- * classes from a javax.naming.Reference instance.
- *
- * @author Hiram Chirino ([EMAIL PROTECTED])
- *
- * @version $Revision: 1.1 $
+ * This class is used to create instances of of: SpyTopicConnectionFactory
+ * SpyQueueConnectionFactory SpyXATopicConnectionFactory
SpyXAQueueConnectionFactory
+ * classes from a javax.naming.Reference instance.
+ *
+ * @author Hiram Chirino ([EMAIL PROTECTED])
+ * @created August 16, 2001
+ * @version $Revision: 1.2 $
*/
public class SpyConnectionFactoryObjectFactory implements
javax.naming.spi.ObjectFactory {
+
+ static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(
SpyConnectionFactoryObjectFactory.class );
-
- /**
- * getObjectInstance method.
- */
- public java.lang.Object getObjectInstance(java.lang.Object reference,
javax.naming.Name name, javax.naming.Context contex, java.util.Hashtable properties)
- throws java.lang.Exception {
-
- cat.debug("SpyConnectionFactoryObjectFactory->getObjectInstance()");
- try {
-
- javax.naming.Reference ref = (javax.naming.Reference)
reference;
- GenericConnectionFactory dcf = (GenericConnectionFactory)
- ObjectRefAddr.extractObjectRefFrom( ref, "DCF");
-
- if
(ref.getClassName().equals("org.jboss.mq.SpyConnectionFactory")) {
- return new org.jboss.mq.SpyConnectionFactory(dcf);
- } else if
(ref.getClassName().equals("org.jboss.mq.SpyXAConnectionFactory")) {
- return new org.jboss.mq.SpyXAConnectionFactory(dcf);
- }
-
- } catch (Throwable ignore) {
- ignore.printStackTrace();
- // This method should not throw an exception since
- // It would prevent another ObjectFactory from attempting
- // to create an instance of the object.
- }
- return null;
- }
- static org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(SpyConnectionFactoryObjectFactory.class);
-}
\ No newline at end of file
+ /**
+ * getObjectInstance method.
+ *
+ * @param reference Description of Parameter
+ * @param name Description of Parameter
+ * @param contex Description of Parameter
+ * @param properties Description of Parameter
+ * @return The ObjectInstance value
+ * @exception java.lang.Exception Description of Exception
+ */
+ public java.lang.Object getObjectInstance( java.lang.Object reference,
javax.naming.Name name, javax.naming.Context contex, java.util.Hashtable properties )
+ throws java.lang.Exception {
+
+ cat.debug( "SpyConnectionFactoryObjectFactory->getObjectInstance()" );
+ try {
+
+ javax.naming.Reference ref = ( javax.naming.Reference )reference;
+ GenericConnectionFactory dcf = ( GenericConnectionFactory )
+ ObjectRefAddr.extractObjectRefFrom( ref, "DCF" );
+
+ if ( ref.getClassName().equals( "org.jboss.mq.SpyConnectionFactory" ) ) {
+ return new org.jboss.mq.SpyConnectionFactory( dcf );
+ } else if ( ref.getClassName().equals(
"org.jboss.mq.SpyXAConnectionFactory" ) ) {
+ return new org.jboss.mq.SpyXAConnectionFactory( dcf );
+ }
+ } catch ( Throwable ignore ) {
+ ignore.printStackTrace();
+ // This method should not throw an exception since
+ // It would prevent another ObjectFactory from attempting
+ // to create an instance of the object.
+ }
+ return null;
+ }
+}
1.2 +51 -52
jbossmq/src/main/org/jboss/mq/referenceable/SpyDestinationObjectFactory.java
Index: SpyDestinationObjectFactory.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/referenceable/SpyDestinationObjectFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SpyDestinationObjectFactory.java 2001/08/11 20:59:15 1.1
+++ SpyDestinationObjectFactory.java 2001/08/17 03:04:06 1.2
@@ -8,59 +8,58 @@
import javax.naming.spi.ObjectFactory;
-
-
-
-
/**
- * This class is used to create instances of of:
- * SpyTopic
- * SpyQueue
- * classes from a javax.naming.Reference instance.
- *
- * @author Hiram Chirino ([EMAIL PROTECTED])
- *
- * @version $Revision: 1.1 $
+ * This class is used to create instances of of: SpyTopic SpyQueue classes from
+ * a javax.naming.Reference instance.
+ *
+ * @author Hiram Chirino ([EMAIL PROTECTED])
+ * @created August 16, 2001
+ * @version $Revision: 1.2 $
*/
public class SpyDestinationObjectFactory implements javax.naming.spi.ObjectFactory {
- /**
- * SpyTopicObjectFactory constructor
- */
- public SpyDestinationObjectFactory() {
- super();
- }
-
- /**
- * getObjectInstance method
- */
- public java.lang.Object getObjectInstance(java.lang.Object reference,
javax.naming.Name name, javax.naming.Context contex, java.util.Hashtable properties)
- throws java.lang.Exception {
-
- cat.debug("SpyDestinationObjectFactory->getObjectInstance()");
-
- try {
-
- javax.naming.Reference ref = (javax.naming.Reference)
reference;
- if (ref.getClassName().equals("org.jboss.mq.SpyTopic")) {
-
- String dest = (String) ref.get("name").getContent();
- return new org.jboss.mq.SpyTopic(dest);
-
- } else if (ref.getClassName().equals("org.jboss.mq.SpyQueue"))
{
-
- String dest = (String) ref.get("name").getContent();
- return new org.jboss.mq.SpyQueue(dest);
-
- }
-
- } catch (RuntimeException ignore) {
- } catch (Exception ignore) {
- // This method should not throw an exception since
- // It would prevent another ObjectFactory from attempting
- // to create an instance of the object.
- }
- return null;
- }
+
+ static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(
SpyDestinationObjectFactory.class );
- static org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(SpyDestinationObjectFactory.class);
-}
\ No newline at end of file
+ /**
+ * SpyTopicObjectFactory constructor
+ */
+ public SpyDestinationObjectFactory() {
+ super();
+ }
+
+ /**
+ * getObjectInstance method
+ *
+ * @param reference Description of Parameter
+ * @param name Description of Parameter
+ * @param contex Description of Parameter
+ * @param properties Description of Parameter
+ * @return The ObjectInstance value
+ * @exception java.lang.Exception Description of Exception
+ */
+ public java.lang.Object getObjectInstance( java.lang.Object reference,
javax.naming.Name name, javax.naming.Context contex, java.util.Hashtable properties )
+ throws java.lang.Exception {
+
+ cat.debug( "SpyDestinationObjectFactory->getObjectInstance()" );
+
+ try {
+
+ javax.naming.Reference ref = ( javax.naming.Reference )reference;
+ if ( ref.getClassName().equals( "org.jboss.mq.SpyTopic" ) ) {
+
+ String dest = ( String )ref.get( "name" ).getContent();
+ return new org.jboss.mq.SpyTopic( dest );
+ } else if ( ref.getClassName().equals( "org.jboss.mq.SpyQueue" ) ) {
+
+ String dest = ( String )ref.get( "name" ).getContent();
+ return new org.jboss.mq.SpyQueue( dest );
+ }
+ } catch ( RuntimeException ignore ) {
+ } catch ( Exception ignore ) {
+ // This method should not throw an exception since
+ // It would prevent another ObjectFactory from attempting
+ // to create an instance of the object.
+ }
+ return null;
+ }
+}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development