User: schaefera
Date: 02/03/05 17:07:50
Modified: varia/src/main/org/jboss/mail MailService.java
Log:
Added some new JSR-77 components written by Scott McLaughlin adding
JCA, JMS and ResourceAdaptor as JSR-77 components.
I also added a new test to see how XMBean and the newest version of
XDoclet can be used to generate the XMBeans as easiest as possible.
Revision Changes Path
1.4 +14 -2 contrib/varia/src/main/org/jboss/mail/MailService.java
Index: MailService.java
===================================================================
RCS file: /cvsroot/jboss/contrib/varia/src/main/org/jboss/mail/MailService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MailService.java 27 Feb 2002 18:45:22 -0000 1.3
+++ MailService.java 6 Mar 2002 01:07:50 -0000 1.4
@@ -39,7 +39,7 @@
* MBean that gives support for JavaMail. Object of class javax.mail.Session will
be bound
* in JNDI under java:/ namespace with the name provided with method {@link
#setJNDIName}.
*
- * @version <tt>$Revision: 1.3 $</tt>
+ * @version <tt>$Revision: 1.4 $</tt>
* @author <a href="mailto:[EMAIL PROTECTED]">Simone Bordet</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
*/
@@ -97,6 +97,13 @@
{
// Create the JSR77 Managed Object
mMail = JavaMail.create(getServer(), "MailSession", getServiceName() );
+ mMail = JavaMail.create(
+ getServer(),
+ getJNDIName().startsWith( "java:/" ) ?
+ getJNDIName().substring( 6 ) :
+ getJNDIName(),
+ getServiceName()
+ );
}
protected void startService() throws Exception
@@ -188,7 +195,12 @@
{
if(mMail != null)
{
- JavaMail.destroy( getServer(), "MailSession" );
+ JavaMail.destroy(
+ getServer(),
+ getJNDIName().startsWith( "java:/" ) ?
+ getJNDIName().substring( 6 ) :
+ getJNDIName()
+ );
mMail = null;
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development