KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > tests > j2eeserver > plugin > jsr88 > DepFactory


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.tests.j2eeserver.plugin.jsr88;
21
22 import javax.enterprise.deploy.spi.factories.DeploymentFactory JavaDoc;
23 import javax.enterprise.deploy.spi.*;
24 import javax.enterprise.deploy.spi.exceptions.*;
25
26 /**
27  *
28  * @author gfink
29  */

30 public class DepFactory implements DeploymentFactory JavaDoc {
31     java.util.Map JavaDoc managers = new java.util.HashMap JavaDoc();
32
33     /** Creates a new instance of DepFactory */
34     public DepFactory() {
35     }
36
37     public javax.enterprise.deploy.spi.DeploymentManager JavaDoc getDeploymentManager(String JavaDoc str, String JavaDoc str1, String JavaDoc str2) throws javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException JavaDoc {
38         DepManager manager = (DepManager) managers.get(str);
39         if (manager == null){
40             manager = new DepManager(str, str1, str2);
41             managers.put(str, manager);
42         }
43         return manager;
44     }
45     
46     public javax.enterprise.deploy.spi.DeploymentManager JavaDoc getDisconnectedDeploymentManager(String JavaDoc str) throws javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException JavaDoc {
47         DepManager manager = (DepManager) managers.get(str);
48         if (manager == null) {
49             manager = new DepManager(str,"","");
50             managers.put(str, manager);
51         }
52         return manager;
53     }
54     
55     public String JavaDoc getDisplayName() {
56         return "Sample JSR88 plugin";// PENDING parameterize this.
57
}
58     
59     public String JavaDoc getProductVersion() {
60         return "0.9";// PENDING version this plugin somehow?
61
}
62     
63     public boolean handlesURI(String JavaDoc str) {
64         return (str != null && str.startsWith("fooservice"));
65     }
66     
67 }
68
Popular Tags