01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.jaxws;
20:
21: import org.apache.axis2.AxisFault;
22: import org.apache.axis2.context.ConfigurationContext;
23: import org.apache.axis2.context.ConfigurationContextFactory;
24: import org.apache.axis2.deployment.DeploymentException;
25: import org.apache.axis2.description.AxisService;
26: import org.apache.axis2.jaxws.util.Constants;
27: import org.apache.axis2.metadata.registry.MetadataFactoryRegistry;
28:
29: /** This class serves as a factory for ConfigurationContexts suitable in the client environment. */
30: public class ClientConfigurationFactory {
31:
32: /** Returns a ClientConfigurationFactory object. */
33: public static ClientConfigurationFactory newInstance() {
34: return (ClientConfigurationFactory) MetadataFactoryRegistry
35: .getFactory(ClientConfigurationFactory.class);
36: }
37:
38: /**
39: * Loads up a ConfigurationContext object using the configuration builder.
40: *
41: * @return a ConfigurationContext object that is suitable for the client environment
42: */
43: public synchronized ConfigurationContext getClientConfigurationContext() {
44: ConfigurationContext configContext = null;
45: //TODO: Add logging
46: String repoPath = System.getProperty(Constants.AXIS2_REPO_PATH);
47: String axisConfigPath = System
48: .getProperty(Constants.AXIS2_CONFIG_PATH);
49: try {
50: configContext = ConfigurationContextFactory
51: .createConfigurationContextFromFileSystem(repoPath,
52: axisConfigPath);
53: } catch (AxisFault e) {
54: // TODO: Add RAS logging and processing
55: e.printStackTrace();
56: }
57: return configContext;
58: }
59:
60: /**
61: * Perform any final client-specific configuration on a newly created AxisService.
62: *
63: * @param service A newly created AxisService on which to perform any final client-related
64: * configuration.
65: * @throws DeploymentException
66: * @throws Exception
67: */
68: public synchronized void completeAxis2Configuration(
69: AxisService service) throws DeploymentException, Exception {
70: }
71: }
|