KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > tools > ant > util > InstallationServiceMoc


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: InstallationServiceMoc.java 14:21:04 ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.tools.ant.util;
23
24 import javax.management.MBeanServer JavaDoc;
25 import javax.management.ObjectName JavaDoc;
26
27 /**
28  * Moc object of the installation service
29  *
30  * @author ddesjardins - eBMWebsourcing
31  */

32 public class InstallationServiceMoc implements InstallationServiceMocMBean {
33
34     private MBeanServer JavaDoc beanServer;
35
36     public InstallationServiceMoc(MBeanServer JavaDoc beanServer) {
37         super();
38         this.beanServer = beanServer;
39     }
40
41     public String JavaDoc installSharedLibrary(String JavaDoc slZipURL) {
42         return "foo003";
43     }
44
45     public ObjectName JavaDoc loadInstaller(String JavaDoc componentName) {
46         return null;
47     }
48
49     public ObjectName JavaDoc loadNewInstaller(String JavaDoc installZipURL) {
50         ObjectName JavaDoc objectName = null;
51         try {
52             objectName = new ObjectName JavaDoc("org.objectweb.petals:type=installer,name=foo001");
53             beanServer.registerMBean(new InstallerMoc(beanServer), objectName);
54         }
55         catch (Exception JavaDoc e) {
56             e.printStackTrace();
57         }
58         return objectName;
59     }
60
61     public boolean uninstallSharedLibrary(String JavaDoc slName) {
62         return true;
63     }
64
65     public boolean unloadInstaller(String JavaDoc aComponentName, boolean isToBeDeleted) {
66         return false;
67     }
68
69 }
70
Popular Tags