KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.io.*;
23 import java.util.Collection JavaDoc;
24 import java.util.HashSet JavaDoc;
25 import javax.enterprise.deploy.model.*;
26 import javax.enterprise.deploy.shared.*;
27 import javax.enterprise.deploy.spi.*;
28 import javax.enterprise.deploy.spi.exceptions.*;
29
30
31 /**
32  *
33  * @author gfink
34  */

35 public class DepConfig implements DeploymentConfiguration {
36
37     DeployableObject dobj;
38     DepManager manager;
39     Collection JavaDoc beans = new HashSet JavaDoc();
40
41     /** Creates a new instance of DepFactory */
42     public DepConfig(DeployableObject dobj, DepManager manager) {
43         this.dobj = dobj; this.manager = manager;
44     }
45     
46     public DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot bean) throws ConfigurationException {
47         ModuleType type = bean.getType();
48         if(type == ModuleType.EAR) {
49             EarConfigBean ret = new EarConfigBean(bean, this);
50             beans.add(ret);
51             return ret;
52         }
53         if(type == ModuleType.EJB) {
54             EjbModuleConfigBean ret = new EjbModuleConfigBean(bean,
55 this);
56             beans.add(ret);
57             return ret;
58         }
59         if(type == ModuleType.WAR) {
60             WebModuleConfigBean ret = new WebModuleConfigBean(bean,
61 this);
62             beans.add(ret);
63             return ret;
64         }
65         return null;
66     }
67     
68     public DeployableObject getDeployableObject() {
69         return dobj;
70     }
71     
72     public void removeDConfigBean(DConfigBeanRoot dConfigBeanRoot) throws BeanNotFoundException {
73     }
74     
75     public void restore(InputStream inputStream) throws ConfigurationException {
76     }
77     
78     public DConfigBeanRoot restoreDConfigBean(InputStream inputStream, DDBeanRoot dDBeanRoot) throws ConfigurationException {
79         throw new ConfigurationException();
80     }
81     
82     public void save(OutputStream outputStream) throws ConfigurationException {
83     }
84     
85     public void saveDConfigBean(OutputStream outputStream, DConfigBeanRoot dConfigBeanRoot) throws ConfigurationException {
86     }
87     
88 }
89
Popular Tags