KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > management > mbeans > ModelService


1 /*
2  * $Id: ModelService.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
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.MuleManager;
14 import org.mule.umo.UMODescriptor;
15 import org.mule.umo.UMOException;
16 import org.mule.umo.model.UMOModel;
17
18 /**
19  * <code>ModelService</code> exposes service information and actions on the Mule
20  * Model
21  *
22  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
23  * @version $Revision: 3798 $
24  */

25 public class ModelService implements ModelServiceMBean
26 {
27     private UMOModel model;
28
29     public ModelService()
30     {
31         model = MuleManager.getInstance().getModel();
32
33     }
34
35     public void start() throws UMOException
36     {
37         model.start();
38     }
39
40     public void stop() throws UMOException
41     {
42         model.stop();
43     }
44
45     public void startComponent(String JavaDoc name) throws UMOException
46     {
47         model.startComponent(name);
48     }
49
50     public void stopComponent(String JavaDoc name) throws UMOException
51     {
52         model.stopComponent(name);
53     }
54
55     public void pauseComponent(String JavaDoc name) throws UMOException
56     {
57         model.pauseComponent(name);
58     }
59
60     public void resumeComponent(String JavaDoc name) throws UMOException
61     {
62         model.resumeComponent(name);
63     }
64
65     public void unregisterComponent(String JavaDoc name) throws UMOException
66     {
67         model.unregisterComponent(model.getDescriptor(name));
68     }
69
70     public boolean isComponentRegistered(String JavaDoc name)
71     {
72         return model.isComponentRegistered(name);
73     }
74
75     public UMODescriptor getComponentDescriptor(String JavaDoc name)
76     {
77         return model.getDescriptor(name);
78     }
79
80     public String JavaDoc getName()
81     {
82         return model.getName();
83     }
84
85     public String JavaDoc getType()
86     {
87         return model.getType();
88     }
89 }
90
Popular Tags