View Javadoc

1   /*
2    * $Id: ConnectorService.java 7963 2007-08-21 08:53:15Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.management.mbeans;
12  
13  import org.mule.umo.UMOException;
14  import org.mule.umo.lifecycle.InitialisationException;
15  import org.mule.umo.provider.UMOConnector;
16  import org.mule.util.ObjectNameHelper;
17  
18  import java.beans.ExceptionListener;
19  
20  public class ConnectorService implements ConnectorServiceMBean
21  {
22      private final UMOConnector connector;
23      private final String name;
24  
25      public ConnectorService(final UMOConnector connector)
26      {
27          this.connector = connector;
28          name = ObjectNameHelper.getConnectorName(connector);
29      }
30  
31      public boolean isStarted()
32      {
33          return connector.isStarted();
34      }
35  
36      public boolean isDisposed()
37      {
38          return connector.isDisposed();
39      }
40  
41      public boolean isDisposing()
42      {
43          return connector.isDisposing();
44      }
45  
46      public String getName()
47      {
48          return name;
49      }
50  
51      public String getProtocol()
52      {
53          return connector.getProtocol();
54      }
55  
56      public ExceptionListener getExceptionListener()
57      {
58          return connector.getExceptionListener();
59      }
60  
61      public void startConnector() throws UMOException
62      {
63          connector.startConnector();
64      }
65  
66      public void stopConnector() throws UMOException
67      {
68          connector.stopConnector();
69      }
70  
71      public void dispose()
72      {
73          connector.dispose();
74      }
75  
76      public void initialise() throws InitialisationException
77      {
78          connector.initialise();
79      }
80  
81  }