User: schaefera
Date: 02/02/26 20:36:45
Modified: varia/src/main/org/jboss/mail MailService.java
Log:
Fixed a problem with dropping a standalone EJB module.
Applied patches from Scott McLaughlin:
- Fixes for EjbModule, EJB, J2EEserver, JDBCDataSource
- Adding JavaMail Resource and its MBean
Revision Changes Path
1.2 +11 -0 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MailService.java 15 Feb 2002 08:11:02 -0000 1.1
+++ MailService.java 27 Feb 2002 04:36:45 -0000 1.2
@@ -33,12 +33,13 @@
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.naming.NonSerializableFactory;
+import org.jboss.management.j2ee.JavaMail;
/**
* 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.1 $</tt>
+ * @version <tt>$Revision: 1.2 $</tt>
* @author <a href="mailto:[EMAIL PROTECTED]">Simone Bordet</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
*/
@@ -50,6 +51,8 @@
private String password;
private String jndiName = JNDI_NAME;
private Element config;
+ /** Object Name of the JSR-77 representant of this servie **/
+ ObjectName mMail;
public void setUser(final String user) {
this.user = user;
@@ -107,6 +110,9 @@
// Finally create a mail session
Session session = Session.getInstance(props, a);
bind(session);
+
+ // Create the JSR77 Managed Object
+ mMail = JavaMail.create(getServer(), "MailSession", getServiceName() );
}
protected Properties getProperties() throws Exception {
@@ -173,6 +179,11 @@
protected void stopService() throws Exception
{
unbind();
+ if(mMail != null)
+ {
+ JavaMail.destroy( getServer(), "MailSession" );
+ mMail = null;
+ }
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development