User: schaefera
Date: 02/02/27 10:45:22
Modified: varia/src/main/org/jboss/mail MailService.java
Log:
Enabled JavaMail MBean to start and stop the Mail Service MBean.
Revision Changes Path
1.3 +11 -5 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MailService.java 27 Feb 2002 04:36:45 -0000 1.2
+++ MailService.java 27 Feb 2002 18:45:22 -0000 1.3
@@ -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.2 $</tt>
+ * @version <tt>$Revision: 1.3 $</tt>
* @author <a href="mailto:[EMAIL PROTECTED]">Simone Bordet</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
*/
@@ -93,6 +93,12 @@
return name == null ? OBJECT_NAME : name;
}
+ protected void createService() throws Exception
+ {
+ // Create the JSR77 Managed Object
+ mMail = JavaMail.create(getServer(), "MailSession", getServiceName() );
+ }
+
protected void startService() throws Exception
{
// Setup password authentication
@@ -110,9 +116,6 @@
// 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 {
@@ -179,13 +182,16 @@
protected void stopService() throws Exception
{
unbind();
+ }
+
+ private void destoryService() throws Exception
+ {
if(mMail != null)
{
JavaMail.destroy( getServer(), "MailSession" );
mMail = null;
}
}
-
private void bind(Session session) throws NamingException
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development