KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > deploy > Undeployer


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 package com.sun.enterprise.management.deploy;
25
26 import java.util.Map JavaDoc;
27 import java.util.HashMap JavaDoc;
28
29 import java.io.Serializable JavaDoc;
30
31 import com.sun.appserv.management.deploy.DeploymentStatus;
32 import com.sun.appserv.management.deploy.DeploymentStatusImpl;
33
34 import com.sun.appserv.management.base.MapCapable;
35
36 /**
37     This implementation of Undeployer is a stub implementation designed
38     to replace the normal implementation when unit tests are being run.
39  */

40 final class Undeployer
41 {
42     private final String JavaDoc mModuleID;
43     private Map JavaDoc<String JavaDoc,String JavaDoc> mParams;
44
45     public Undeployer(final String JavaDoc moduleID, final Map JavaDoc<String JavaDoc,String JavaDoc> params)
46     {
47         mModuleID = moduleID;
48         mParams = params;
49     }
50
51         public DeploymentStatus
52     undeploy()
53     {
54         final Map JavaDoc<String JavaDoc,Serializable JavaDoc> m = new HashMap JavaDoc<String JavaDoc,Serializable JavaDoc>();
55         m.put( MapCapable.MAP_CAPABLE_CLASS_NAME_KEY,
56             DeploymentStatus.DEPLOYMENT_STATUS_CLASS_NAME);
57             
58         m.put( DeploymentStatus.STAGE_STATUS_KEY, new Integer JavaDoc( 0 ) );
59         m.put( DeploymentStatus.STAGE_STATUS_MESSAGE_KEY, "stubbed dummy" );
60         
61         return new DeploymentStatusImpl( m );
62     }
63 }
64
65
Popular Tags