KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > jbi > deployment > Component


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.jbi.deployment;
18
19 /**
20  * @version $Revision: 426415 $
21  */

22 public class Component {
23     private String JavaDoc type;
24     private String JavaDoc componentClassLoaderDelegation = "parent-first";
25     private String JavaDoc bootstrapClassLoaderDelegation = "parent-first";
26     private Identification identification;
27     private String JavaDoc componentClassName;
28     private String JavaDoc description;
29     private ClassPath componentClassPath;
30     private String JavaDoc bootstrapClassName;
31     private ClassPath bootstrapClassPath;
32     private SharedLibraryList[] sharedLibraries;
33     private InstallationDescriptorExtension descriptorExtension;
34
35     public boolean isServiceEngine() {
36         return type != null && type.equals("service-engine");
37     }
38
39     public boolean isBindingComponent() {
40         return type != null && type.equals("binding-component");
41     }
42
43     public boolean isComponentClassLoaderDelegationParentFirst() {
44         return isParentFirst(componentClassLoaderDelegation);
45     }
46
47     public boolean isComponentClassLoaderDelegationSelfFirst() {
48         return isSelfFirst(componentClassLoaderDelegation);
49     }
50
51     public boolean isBootstrapClassLoaderDelegationParentFirst() {
52         return isParentFirst(bootstrapClassLoaderDelegation);
53     }
54
55     public boolean isBootstrapClassLoaderDelegationSelfFirst() {
56         return isSelfFirst(bootstrapClassLoaderDelegation);
57     }
58
59
60     // Properties
61
//-------------------------------------------------------------------------
62
public String JavaDoc getType() {
63         return type;
64     }
65
66     public void setType(String JavaDoc type) {
67         this.type = type;
68     }
69
70     public String JavaDoc getComponentClassLoaderDelegation() {
71         return componentClassLoaderDelegation;
72     }
73
74     public void setComponentClassLoaderDelegation(String JavaDoc componentClassLoaderDelegation) {
75         this.componentClassLoaderDelegation = componentClassLoaderDelegation;
76     }
77
78     public String JavaDoc getBootstrapClassLoaderDelegation() {
79         return bootstrapClassLoaderDelegation;
80     }
81
82     public void setBootstrapClassLoaderDelegation(String JavaDoc bootstrapClassLoaderDelegation) {
83         this.bootstrapClassLoaderDelegation = bootstrapClassLoaderDelegation;
84     }
85
86     public Identification getIdentification() {
87         return identification;
88     }
89
90     public void setIdentification(Identification identification) {
91         this.identification = identification;
92     }
93
94     public String JavaDoc getComponentClassName() {
95         return componentClassName;
96     }
97
98     public void setComponentClassName(String JavaDoc componentClassName) {
99         this.componentClassName = componentClassName;
100     }
101
102     public String JavaDoc getDescription() {
103         return description;
104     }
105
106     public void setDescription(String JavaDoc description) {
107         this.description = description;
108     }
109
110     public ClassPath getComponentClassPath() {
111         return componentClassPath;
112     }
113
114     public void setComponentClassPath(ClassPath componentClassPath) {
115         this.componentClassPath = componentClassPath;
116     }
117
118     public String JavaDoc getBootstrapClassName() {
119         return bootstrapClassName;
120     }
121
122     public void setBootstrapClassName(String JavaDoc bootstrapClassName) {
123         this.bootstrapClassName = bootstrapClassName;
124     }
125
126     public ClassPath getBootstrapClassPath() {
127         return bootstrapClassPath;
128     }
129
130     public void setBootstrapClassPath(ClassPath bootstrapClassPath) {
131         this.bootstrapClassPath = bootstrapClassPath;
132     }
133
134     public SharedLibraryList[] getSharedLibraries() {
135         return sharedLibraries;
136     }
137
138     public void setSharedLibraries(SharedLibraryList[] sharedLibraries) {
139         this.sharedLibraries = sharedLibraries;
140     }
141
142     public InstallationDescriptorExtension getDescriptorExtension() {
143         return descriptorExtension;
144     }
145
146     public void setDescriptorExtension(InstallationDescriptorExtension descriptorExtension) {
147         this.descriptorExtension = descriptorExtension;
148     }
149
150     // Implementation methods
151
//-------------------------------------------------------------------------
152
protected boolean isParentFirst(String JavaDoc text) {
153         return text != null && text.equalsIgnoreCase("parent-first");
154     }
155
156     protected boolean isSelfFirst(String JavaDoc text) {
157         return text != null && text.equalsIgnoreCase("self-first");
158     }
159     
160     
161 }
162
Popular Tags