KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > archivist > ConnectorArchivist


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.deployment.archivist;
25
26 import java.io.InputStream JavaDoc;
27 import java.io.IOException JavaDoc;
28 import java.util.logging.Level JavaDoc;
29 import javax.enterprise.deploy.shared.ModuleType JavaDoc;
30
31 import com.sun.enterprise.deployment.ConnectorDescriptor;
32 import com.sun.enterprise.deployment.deploy.shared.AbstractArchive;
33 import com.sun.enterprise.deployment.Descriptor;
34 import com.sun.enterprise.deployment.io.ConnectorDeploymentDescriptorFile;
35 import com.sun.enterprise.deployment.io.DeploymentDescriptorFile;
36 import com.sun.enterprise.deployment.io.runtime.ConnectorRuntimeDDFile;
37 import com.sun.enterprise.deployment.node.connector.ConnectorNode;
38 import com.sun.enterprise.deployment.util.DOLUtils;
39
40 /**
41  * This class is responsible for handling J2EE Connector archive files.
42  *
43  * @author Sheetal Vartak
44  * @version
45  */

46 public class ConnectorArchivist extends Archivist {
47
48     ConnectorDescriptor descriptor = null;
49     
50     /**
51      * The DeploymentDescriptorFile handlers we are delegating for XML i/o
52      */

53     DeploymentDescriptorFile standardDD = new ConnectorDeploymentDescriptorFile();
54     
55     /** Creates new ConnectorArchvisit */
56     public ConnectorArchivist() {
57     }
58
59     /**
60      * @return the module type handled by this archivist
61      * as defined in the application DTD
62      *
63      */

64     public ModuleType JavaDoc getModuleType() {
65         return ModuleType.RAR;
66     }
67           
68     /**
69      * Set the DOL descriptor for this Archivist, used by super classes
70      */

71     public void setDescriptor(Descriptor descriptor) {
72         if (descriptor instanceof ConnectorDescriptor) {
73             this.descriptor = (ConnectorDescriptor) descriptor;
74         } else {
75             DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.descriptorFailure", new Object JavaDoc[] {this});
76         }
77     }
78     
79     /**
80      * @return the DeploymentDescriptorFile responsible for handling
81      * standard deployment descriptor
82      */

83     public DeploymentDescriptorFile getStandardDDFile() {
84         return standardDD;
85     }
86     
87     /**
88      * @return if exists the DeploymentDescriptorFile responsible for
89      * handling the configuration deployment descriptors
90      */

91     public DeploymentDescriptorFile getConfigurationDDFile() {
92         return new ConnectorRuntimeDDFile();
93     }
94     
95     /**
96      * @return the Descriptor for this archvist
97      */

98     public Descriptor getDescriptor() {
99         return descriptor;
100     }
101
102     /**
103      * @return a default BundleDescriptor for this archivist
104      */

105     public Descriptor getDefaultBundleDescriptor() {
106         ConnectorDescriptor connectorDesc =
107             new ConnectorDescriptor();
108         return connectorDesc;
109     }
110
111     protected boolean postHandles(AbstractArchive abstractArchive)
112             throws IOException JavaDoc {
113         return false;
114     }
115
116     protected String JavaDoc getArchiveExtension() {
117         return CONNECTOR_EXTENSION;
118     }
119 }
120
Popular Tags