01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.geronimo.webservices.saaj;
17:
18: import org.apache.geronimo.gbean.GBeanInfo;
19: import org.apache.geronimo.gbean.GBeanInfoBuilder;
20: import org.apache.geronimo.gbean.GBeanLifecycle;
21: import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
22:
23: public class SAAJGBean implements GBeanLifecycle {
24:
25: public SAAJGBean() {
26: }
27:
28: public void doStart() throws Exception {
29: setProperty("javax.xml.soap.MessageFactory",
30: "org.apache.geronimo.webservices.saaj.GeronimoMessageFactory");
31: setProperty("javax.xml.soap.SOAPFactory",
32: "org.apache.geronimo.webservices.saaj.GeronimoSOAPFactory");
33: setProperty("javax.xml.soap.SOAPConnectionFactory",
34: "org.apache.geronimo.webservices.saaj.GeronimoSOAPConnectionFactory");
35: setProperty("javax.xml.soap.MetaFactory",
36: "org.apache.geronimo.webservices.saaj.GeronimoMetaFactory");
37: }
38:
39: private void setProperty(String propertyName, String value) {
40: String propValue = System.getProperty(propertyName);
41: // set only if the property is not set
42: if (propValue == null) {
43: System.setProperty(propertyName, value);
44: }
45: }
46:
47: public void doStop() throws Exception {
48: }
49:
50: public void doFail() {
51: }
52:
53: public static final GBeanInfo GBEAN_INFO;
54:
55: static {
56: GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(
57: SAAJGBean.class, SAAJGBean.class,
58: NameFactory.GERONIMO_SERVICE);
59:
60: GBEAN_INFO = infoFactory.getBeanInfo();
61: }
62:
63: public static GBeanInfo getGBeanInfo() {
64: return GBEAN_INFO;
65: }
66:
67: }
|