You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by jl...@apache.org on 2007/10/25 19:10:56 UTC
svn commit: r588283 [4/18] - in /incubator/cxf/branches/jliu: ./ api/
api/src/main/java/org/apache/cxf/databinding/
api/src/main/java/org/apache/cxf/io/
api/src/main/java/org/apache/cxf/message/
api/src/main/java/org/apache/cxf/phase/ api/src/main/java...
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/release_notes.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/release_notes.txt?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/release_notes.txt (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/release_notes.txt Thu Oct 25 10:09:20 2007
@@ -1,17 +1,16 @@
-Apache CXF 2.0.1 (incubating) Release Notes
+Apache CXF 2.0.2 (incubating) Release Notes
1. Overview
-Apache CXF 2.0.1, under incubation, delivers the second milestone of
+Apache CXF 2.0.2, under incubation, delivers the second milestone of
the Celtix project (http://celtix.objectweb.org) and the XFire project
(http://xfire.codehaus.org) merge. This release is mostly a patch release
-from 2.0. However, there are some new features as well:
- * Enable HTTPSession & Session use
- * Ant tasks for tools
- * Add support for <databinding> in endpoint & client configuration
- * Allow access to Jetty Server or at least Context object
- * Configuring interceptors using annotations
- * Feature Support for the Bus
+from 2.0.1. However, there are some new features as well:
+ * Configuration support for the WS-Policy engine
+ * WS-Addressing Feature (easier to configure WS-A)
+ * WS-Reliable Messaging Feature (easier to configure WS-RM)
+ * Lots of sample improvements
+ * Several Spring configuration improvements
2. Installation Prerequisites
@@ -50,6 +49,17 @@
For more details, see the Installation Guide.
+
+2.3 Bouncy Castle/JCE requirement for WS-Security
+
+To use the WS-Security features of CXF, you need to obtain a JCE crypto provider
+that implements the algorithms that you plan to use. One option is to download
+the Bouncy Castle jar from:
+http://bouncycastle.org/download/bcprov-jdk14-136.jar
+and add that to the lib directory or classpath.
+
+
+
3. Building the Samples
Building the samples included in the binary distribution is easy. Change to
@@ -70,91 +80,102 @@
http://issues.apache.org/jira/browse/CXF
6. Specific issues, features, and improvements fixed in the
-Apache CXF 2.0.1 (incubating) release:
+Apache CXF 2.0.2 (incubating) release:
+
+Release Notes - CXF - Version 2.0.2
-Release Notes - CXF - Version 2.0.1
+** Sub-task
+ * [CXF-901] - Update "WAR" building for full war
+ * [CXF-902] - Add java_first_pojo sample
** Bug
- * [CXF-362] - wsdltojava generated code has inconsistent style
- * [CXF-369] - xsd:dateTime becomes XMLGregorianCalendarImpl when Date needed
- * [CXF-493] - -b option doesn't work
- * [CXF-510] - SpringBusFactory only use DEFAULT_BUS_ID to create bus from context
- * [CXF-527] - JaxwsServiceFactoryBean bugs with RPC style
- * [CXF-655] - String[] cann't be input paras or return value when use doc/lit of code first way
- * [CXF-706] - Multiple Http Destinations cannot use the same address when using HTTPS.
- * [CXF-745] - JAXB Data Binding Generates Duplicate Fault Elements in Generated WSDL
- * [CXF-747] - Redundant Interceptors in the request-response chain while using Provider API
- * [CXF-750] - Support using Session in standalone
- * [CXF-773] - Logical/Soap handlers does not work on the Provider side.
- * [CXF-777] - velocity engine write errors (NPE)
- * [CXF-779] - missing jar file(s) in lib directory of 2.0 release or bad wiki page
- * [CXF-781] - Duplicate type error from Aegis on code that worked fine with XFire 1.2.5
- * [CXF-782] - wsdl2java generated wrong package name
- * [CXF-783] - Ant tasks for tools don't provide helpful error messages
- * [CXF-784] - Interceptor not setting the fault chain for HTTP Binding
- * [CXF-785] - Aegis crashes instead of diagnosing namespace error in .aegis.xml file
- * [CXF-789] - JaxWsServiceConfiguration doesn't correctly find operations with an implementor
- * [CXF-790] - SOAP headers copied from input SOAPMessage to output SOAPMessage
- * [CXF-798] - wsdlvalidator cannot validate on-line wsdl
- * [CXF-800] - Resource matching in jra seems incorrect
- * [CXF-802] - Java first with unqualified/unannotated JAXB objects don't generate proper soap messages....
- * [CXF-804] - wsdl2java fails to generate code for the imported wsdl
- * [CXF-809] - no cygwin support in java2wsdl script
- * [CXF-810] - Client and Server classes in ant script generated by wsdl2java are not correct
- * [CXF-811] - Aegis omits type from WSDL, perhaps particularly when .aegis.xml file is trivial.
- * [CXF-813] - In java first, JAX-WS is using all methods on the IMPL instead of just the ones on the endpoint interface
- * [CXF-814] - In java first wrapped/doc/lit, if Impl and Interface have different targetNamespaces, the "parts" are not read
- * [CXF-818] - Code first, client side, RCP/lit doesn't work without a WSDL
- * [CXF-819] - WSS4JInterceptors don't allow to have a password callback handler by reference
- * [CXF-821] - Current CXFservletTransportFactory don't support the conduit Initiator interface
- * [CXF-824] - SOAPAction can't be used to select an operation
- * [CXF-839] - Fix misspelling of "prefix"
- * [CXF-841] - SOAP RPC/Lit uses paramOrder when sending messages instead of the order in the message
- * [CXF-842] - Code first, RPC/Lit with lots of inouts/outs/headers doesn't work
- * [CXF-843] - Code first, Multiple out headers is only putting one soap:header element in the wsdl
- * [CXF-844] - RPC/Lit null value parameters are skipped
- * [CXF-845] - OneWay operations against JAX-WS RI server don't work
- * [CXF-846] - MTOM Content-Type header is invalid
- * [CXF-848] - WSDLValidator not working well with the bundle jar
- * [CXF-850] - performance of repeated calls to jaxws.Service.createPort is poor, jaxb context is created every time
- * [CXF-855] - Wsdl2Service not working
+ * [CXF-687] - SOAP over HTTP messages have two Content-Type headers and SOAP action as a separate header
+ * [CXF-849] - SSLUtils logs too much at INFO level
+ * [CXF-869] - jaxws:endpoint, simple:client not support setting binding element value
+ * [CXF-870] - WebService methods generated from implementation instead of interface
+ * [CXF-874] - Problems with service beans that use AOP
+ * [CXF-882] - @Features and @XXInterceptors doesn't work for client proxies
+ * [CXF-886] - XSD2WSDL Tool seems to be unable to access remote xsdurls
+ * [CXF-897] - Default JAXB Data Binding does not unmarshal parameters correctly for a POJO service
+ * [CXF-898] - Invalid links in Service Listing at root of CXF servlet if the context path does not end in '/'
+ * [CXF-900] - Generated exception classes don't have serialVersionID
+ * [CXF-903] - HTTP binding/REST does not handle Wrapped request correctly
+ * [CXF-904] - Tools output (-help) needs reformatting
+ * [CXF-906] - ClassCastException in CXFServlet.loadSpringBus when context initialization fails
+ * [CXF-910] - maven codegen plugin needs to allow passing arguments for java2wsdl goal
+ * [CXF-911] - java2wsdl goal of the codegen plugin does not throw an exception to stop the maven build on error
+ * [CXF-912] - java2wsdl goal of the codegen plugin turns off all maven output if the 'quiet' tag is set...
+ * [CXF-915] - ASM3.0 dependency affects spring 2.0 functionality
+ * [CXF-916] - Package renaming needed from org.codehaus.xfire -> org.apache.cxf?
+ * [CXF-918] - java code from wsdl2java for wrapped style if request and response have elements with the same names and different datatypes
+ * [CXF-925] - ClassCastException in JAXBEncoderDecoder.unmarshall()
+ * [CXF-926] - JAX-WS code first fault mapping is not writing proper element name on wire if detail has XmlRootElement
+ * [CXF-929] - Https connections recreated for each request
+ * [CXF-934] - Remove redundant configuration in WS-Security unit tests
+ * [CXF-936] - HTTPConduit requires geronimo-mail, cannot use Sun's mail jar
+ * [CXF-937] - Features does not work with a JAX-WS Dispatch Client when defined via spring config.
+ * [CXF-938] - URIMapper did not handle Wrapped/Unwrapped operation correctly when service is in wrapped mode
+ * [CXF-939] - wsdl defining two different operations on the same port using the same messages lead to wsdl2java producing wrong code instead of an error message
+ * [CXF-942] - throwing SOAPFault from IMPL is not correctly mapped on the wire
+ * [CXF-943] - Doc/Lit/Bare creating wrong element names in wsdl
+ * [CXF-944] - Switch URI of BookService test from xfire.codehaus.org to cxf.apache.org
+ * [CXF-946] - AOP with WS Endpoint
+ * [CXF-947] - FaultInfoExceptions don't work when migrating from XFire to CXF
+ * [CXF-950] - CXF WSDL2Java tool doesnt work well for the WCF RPC/Literal wsdl.
+ * [CXF-951] - RCPInInterceptor not adding all the normal attributes to the message
+ * [CXF-953] - In services list, last character in link url is swallowed when no trailing slash is available
+ * [CXF-955] - Implicit dependency from jaxws:endpoint on httpj:engine-factory is not encoded in Spring
+ * [CXF-959] - Incorrect namespace configuration when generating wsdl from Aegis databinding
+ * [CXF-960] - JAX-WS client interfaces that inherit from other interfaces don't map all the operations
+ * [CXF-961] - In tomcat, AuthorizationPolicy object is not found in Message
+ * [CXF-966] - SESSION_MAINTAIN_PROPERTY doesn't track cookies other than JSESSIONID
+ * [CXF-967] - WSDL2Java tool doesnt generate code for empty Input/Output (RPC/Literal)
+ * [CXF-971] - DefinitionParsers don't ignore namespace attributes
+ * [CXF-974] - Jaxws and simple front ends do not support set serviceName and endpointName from spring configuration
+ * [CXF-975] - WS-Policy distribution sample uses outdated cxf policy namespaces
+ * [CXF-978] - WSDL2Java generated code will miss the parameter for wsdl operation has "parameterOrder" attribute.
** Improvement
- * [CXF-268] - support <extension> and <extensionArgs> for the cxf-codegen-plugin so that XJC plugins can be used with the wsdl2java tool
- * [CXF-425] - Insufficient error handling in fault observers
- * [CXF-744] - Text improvements to error, usage messages for management console
- * [CXF-746] - Text improvements to frontend Messages.properties files
- * [CXF-753] - Text improvements
- * [CXF-757] - Switch to Ant build.xml file for new client_js sample.
- * [CXF-770] - Fixed messages in messages.properties
- * [CXF-795] - adding the spring configuration support for the Jetty server
- * [CXF-805] - wsdl2java error message improvement
- * [CXF-817] - Add support for configurable invoker in cxf.xml
- * [CXF-820] - With Doc/Lit/Wrapped and array/list types, generated wsdl has unreferences array schemas
- * [CXF-856] - Improvements to messages in Jetty_http transport
+ * [CXF-232] - Unify dispatch/providers with JAX-WS
+ * [CXF-340] - Support adding extra classes to JAXB context
+ * [CXF-488] - Add java2wsdl support for the Maven plugin
+ * [CXF-661] - Jetty Destination not programatically configurable
+ * [CXF-743] - Standardized text in README files for each of the samples.
+ * [CXF-763] - samples improvement
+ * [CXF-871] - Improve message strings in CLI tools
+ * [CXF-887] - messages.properties improvements in org.apache.cxf.jbi.se
+ * [CXF-888] - Control directory for on-disk attachments
+ * [CXF-899] - Missing getFaultInfo() fallback patch - use @WebFault bean as faultInfo if getFaultInfo() is not present
+ * [CXF-928] - wsdl2java should not overwrite existing files
+ * [CXF-930] - XercesImpl.jar needs to be added to CXF_HOME/lib directory
+ * [CXF-931] - UNnecessary library dependency
+ * [CXF-965] - add groovy and ruby script samples
+ * [CXF-972] - Define a tns prefix
** New Feature
- * [CXF-749] - Enable HTTPSession & Session use
- * [CXF-760] - Ant tasks for tools
- * [CXF-767] - Autogenerate spring ID for <jaxws:endpoint>, <server>, etc
- * [CXF-768] - Add support for <databinding> in endpoint & client configuration
- * [CXF-792] - Allow access to Jetty Server or at least Context object
- * [CXF-803] - Configuring interceptors using annotations
-
+ * [CXF-861] - WS-Reliable Messaging Feature
** Task
- * [CXF-734] - Changed the print code to assert code in the PolicyTest
- * [CXF-742] - Add Feature Support for the Bus
+ * [CXF-771] - Upgrade to Neethi 2.0.2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-** Test
- * [CXF-112] - CXF performance testing and tuning
- * [CXF-150] - Interop testing with WCF, Axis2
-** Wish
- * [CXF-762] - Can it be available to skip following JAXB error about same name by user option?
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/common_build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/common_build.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/common_build.xml (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/common_build.xml Thu Oct 25 10:09:20 2007
@@ -58,10 +58,13 @@
</path>
<condition property="is.java.version.15">
- <equals arg1="${ant.java.version}" arg2="1.5"/>
+ <or>
+ <equals arg1="${ant.java.version}" arg2="1.5"/>
+ <equals arg1="${ant.java.version}" arg2="1.6"/>
+ </or>
</condition>
- <fail message="Apache CXF requires Java version 1.5. You are currently using Java version ${ant.java.version}."
+ <fail message="Apache CXF requires Java version 1.5 or higher. You are currently using Java version ${ant.java.version}."
unless="is.java.version.15"/>
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/build.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/build.xml (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/build.xml Thu Oct 25 10:09:20 2007
@@ -70,7 +70,7 @@
<fileset dir="${cxf.home}/lib">
<include name="*annotation*" />
<include name="*ws-metadata*" />
- <include name="activation*" />
+ <include name="*activation*" />
<include name="jaxb*" />
<include name="stax*" />
<include name="jsr181*" />
@@ -155,7 +155,7 @@
-->
<target name="activate" description="updates ejb_servants.properties for demo " unless="GreeterBean">
<property name="servant.definition"
- value="GreeterBean={http://apache.org/hello_world_soap_http}Greeter@file:"/>
+ value="GreeterBean={http://apache.org/hello_world_soap_http}Greeter@"/>
<echo message="updating ${servants.props.file}" />
<echo file="${servants.props.file}" append="true">
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/etc/weblogic-ejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/etc/weblogic-ejb-jar.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/etc/weblogic-ejb-jar.xml (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/integration/jca/inbound/etc/weblogic-ejb-jar.xml Thu Oct 25 10:09:20 2007
@@ -18,11 +18,11 @@
under the License.
-->
-<jboss-ejb-jar>
+<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90">
- <jboss-enterprise-bean>
+ <weblogic-enterprise-bean>
<ejb-name>GreeterBean</ejb-name>
<jndi-name>GreeterBean</jndi-name>
- </jboss-enterprise-bean>
+ </weblogic-enterprise-bean>
-</jboss-ejb-jar>
+</weblogic-ejb-jar>
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/mtom/src/demo/mtom/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/mtom/src/demo/mtom/client/Client.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/mtom/src/demo/mtom/client/Client.java (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/mtom/src/demo/mtom/client/Client.java Thu Oct 25 10:09:20 2007
@@ -52,7 +52,7 @@
Client client = new Client();
if (args.length == 0) {
- System.out.println("please specify wsdl");
+ System.out.println("Please specify the WSDL file.");
System.exit(1);
}
URL wsdlURL;
@@ -77,21 +77,21 @@
}
Holder<byte[]> param = new Holder<byte[]>();
param.value = new byte[(int) fileSize];
- System.out.println("Start test without Mtom enable!");
- System.out.println("Sending out the me.bmp Image content to server, data size is " + fileSize);
+ System.out.println("Start test without MTOM enabled:");
+ System.out.println("Sending out the me.bmp image content to server, data size is " + fileSize);
InputStream in = client.getClass().getResourceAsStream("me.bmp");
in.read(param.value);
Holder<String> name = new Holder<String>("call detail");
port.testXop(name, param);
- System.out.println("received byte[] back from server, the size is " + param.value.length);
+ System.out.println("Received byte[] back from server, returned size is " + param.value.length);
Image image = ImageIO.read(new ByteArrayInputStream(param.value));
- System.out.println("build image with the returned byte[] back from server successfully, hashCode="
+ System.out.println("Build image with the returned byte[] back from server successfully, hashCode="
+ image.hashCode());
- System.out.println("Successfully run demo without mtom enable");
+ System.out.println("Successfully ran demo without MTOM enabled");
- System.out.println("Start test with Mtom enable!");
+ System.out.println("Start test with MTOM enabled:");
System.out.println("Sending out the me.bmp Image content to server, data size is " + fileSize);
Holder<DataHandler> handler = new Holder<DataHandler>();
byte[] data = new byte[(int) fileSize];
@@ -105,8 +105,8 @@
fileSize++;
}
- System.out.println("received DataHandler back from server, the size is " + fileSize);
- System.out.println("Successfully run demo with mtom enable");
+ System.out.println("Received DataHandler back from server, returned size is " + fileSize);
+ System.out.println("Successfully ran demo with MTOM enabled");
System.exit(0);
}
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_dispatch/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_dispatch/README.txt?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_dispatch/README.txt (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_dispatch/README.txt Thu Oct 25 10:09:20 2007
@@ -49,8 +49,7 @@
JAX-WS Provider interface.
-Please review the README in the samples directory before
-continuing.
+Please review the README in the samples directory before continuing.
Prerequisites
@@ -86,7 +85,7 @@
Building the demo using wsdl2java and javac
-------------------------------------------
-From the samples/restful directory, first create the target
+From the samples/restful_dispatch directory, first create the target
directory build/classes and then compile the provided client
and server applications with the commands:
@@ -120,7 +119,7 @@
Running the demo using java
---------------------------
-From the samples/restful directory run the following commands. They
+From the samples/restful_dispatch directory run the following commands. They
are entered on a single command line.
For UNIX (must use forward slashes):
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb Thu Oct 25 10:09:20 2007
@@ -1 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
Customer
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/ruby_spring_support/src/demo/spring/HelloWorldImpl.rb
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/ruby_spring_support/src/demo/spring/HelloWorldImpl.rb?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/ruby_spring_support/src/demo/spring/HelloWorldImpl.rb (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/ruby_spring_support/src/demo/spring/HelloWorldImpl.rb Thu Oct 25 10:09:20 2007
@@ -1,3 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
require 'java'
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/addr-external.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/addr-external.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/addr-external.xml (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/addr-external.xml Thu Oct 25 10:09:20 2007
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-<attachments xmlns:wsp="http://www.w3.org/2006/07/ws-policy" xmlns:wsa="http://www.w3.org/2005/08/addressing">
+<attachments xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsp:PolicyAttachment>
<wsp:AppliesTo>
<wsa:EndpointReference>
Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/wsdl/hello_world_addr_policy.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/wsdl/hello_world_addr_policy.wsdl?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/wsdl/hello_world_addr_policy.wsdl (original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/ws_policy/wsdl/hello_world_addr_policy.wsdl Thu Oct 25 10:09:20 2007
@@ -167,12 +167,11 @@
<wsdl:service name="SOAPService">
<wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
<soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
- <wsp:Policy xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
+ <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
<wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata">
<wsp:Policy/>
</wsam:Addressing>
</wsp:Policy>
- <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Modified: incubator/cxf/branches/jliu/etc/eclipse/codetemplates.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/etc/eclipse/codetemplates.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/etc/eclipse/codetemplates.xml (original)
+++ incubator/cxf/branches/jliu/etc/eclipse/codetemplates.xml Thu Oct 25 10:09:20 2007
@@ -44,9 +44,7 @@
* ${tags}
*/</template><template autoinsert="false" context="fieldcomment_context" deleted="false" description="Comment for fields" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name="fieldcomment"></template><template autoinsert="true" context="methodcomment_context" deleted="false" description="Comment for non-overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name="methodcomment">/**
* ${tags}
- */</template><template autoinsert="true" context="overridecomment_context" deleted="false" description="Comment for overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name="overridecomment">/* (non-Javadoc)
- * ${see_to_overridden}
- */</template><template autoinsert="true" context="delegatecomment_context" deleted="false" description="Comment for delegate methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name="delegatecomment">/**
+ */</template><template autoinsert="true" context="overridecomment_context" deleted="false" description="Comment for overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name="overridecomment">/** {@inheritDoc}*/</template><template autoinsert="true" context="delegatecomment_context" deleted="false" description="Comment for delegate methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name="delegatecomment">/**
* ${tags}
* ${see_to_target}
*/</template><template autoinsert="true" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">${filecomment}
@@ -60,4 +58,4 @@
</template><template autoinsert="true" context="catchblock_context" deleted="false" description="Code in new catch blocks" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.catchblock" name="catchblock">// ${todo} Auto-generated catch block
${exception_var}.printStackTrace();</template><template autoinsert="true" context="methodbody_context" deleted="false" description="Code in created method stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodbody" name="methodbody">// ${todo} Auto-generated method stub
${body_statement}</template><template autoinsert="true" context="constructorbody_context" deleted="false" description="Code in created constructor stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name="constructorbody">${body_statement}
-// ${todo} Auto-generated constructor stub</template><template autoinsert="true" context="getterbody_context" deleted="false" description="Code in created getters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.getterbody" name="getterbody">return ${field};</template><template autoinsert="true" context="setterbody_context" deleted="false" description="Code in created setters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.setterbody" name="setterbody">${field} = ${param};</template></templates>
\ No newline at end of file
+// ${todo} Auto-generated constructor stub</template><template autoinsert="true" context="getterbody_context" deleted="false" description="Code in created getters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.getterbody" name="getterbody">return ${field};</template><template autoinsert="true" context="setterbody_context" deleted="false" description="Code in created setters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.setterbody" name="setterbody">${field} = ${param};</template></templates>
Modified: incubator/cxf/branches/jliu/integration/jbi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jbi/pom.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jbi/pom.xml (original)
+++ incubator/cxf/branches/jliu/integration/jbi/pom.xml Thu Oct 25 10:09:20 2007
@@ -56,60 +56,38 @@
<version>${project.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-jbi</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-jbi</artifactId>
<version>${project.version}</version>
</dependency>
-
-
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-testutils</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
-
-
-
-
<dependency>
<groupId>org.apache.servicemix</groupId>
<artifactId>servicemix-jbi</artifactId>
- <version>${servicemix.version}</version>
<scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>servicemix</groupId>
- <artifactId>jaxp</artifactId>
- </exclusion>
- <exclusion>
- <groupId>mx4j</groupId>
- <artifactId>mx4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
-
-
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${project.version}</version>
</dependency>
-
-
-
</dependencies>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/integration/jbi</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/integration/jbi</developerConnection>
- <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-integration-jbi</url>
+ <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-integration-jbi</url>
</scm>
</project>
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/connector/CXFConnectionFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/connector/CXFConnectionFactory.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/connector/CXFConnectionFactory.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/connector/CXFConnectionFactory.java Thu Oct 25 10:09:20 2007
@@ -18,9 +18,7 @@
*/
package org.apache.cxf.connector;
-import java.net.URL;
import javax.resource.ResourceException;
-import javax.xml.namespace.QName;
/**
* Provides methods to create a {@link Connection} object that represents a Web
@@ -29,68 +27,18 @@
*/
public interface CXFConnectionFactory {
-
- /**
- * Creates a client proxy based on the given WSDL information.
- *
- * @param iface The interface class implemented by the returned proxy.
- * @param wsdlLocation The URL to the WSDL that defines the service.
- * @param serviceName The QName that identifies the service.
- * @param portName The port to connect to; services may include multiple
- * ports.
- * @return a proxy object that implements both the given <code>iface</code>
- * and the {@link Connection} interface. It represents the Web
- * service associated with the specified service and port.
- * @throws ResourceException If there is an error creating the connection.
- */
- Object getConnection(Class iface, URL wsdlLocation, QName serviceName, QName portName)
- throws ResourceException;
-
+
/**
- * Creates a client proxy based on the given WSDL information. If the
- * service contains more than one port the first one will be used.
- *
- * @param iface The interface class implemented by the returned proxy.
- * @param wsdlLocation The URL to the WSDL that defines the service.
- * @param serviceName The QName that identifies the service.
+ * Creates a client proxy based on the connection parameter object.
+ * @param param,
* @return A proxy object that implements both the given <code>iface</code>
* and the {@link Connection} interface. It represents the Web
* service associated with the specified service.
- * @throws ResourceException If there is an error creating the connection.
+ * @throws ResourceException
*/
- Object getConnection(Class iface, URL wsdlLocation, QName serviceName) throws ResourceException;
-
- /**
- * Creates a client proxy based on the given WSDL information. The WSDL
- * location will be obtained from Bus configuration using the
- * <code>serviceName</code>.
- *
- * @param iface The interface class implemented by the returned proxy.
- * @param serviceName The QName that identifies the service.
- * @param portName The port to connect to; services may include multiple
- * ports.
- * @return A proxy object that implements both the given <code>iface</code>
- * and the {@link Connection} interface. It represents the Web
- * service associated with the specified service and port.
- * @throws ResourceException If there is an error creating the connection.
- */
- Object getConnection(Class iface, QName serviceName, QName portName) throws ResourceException;
-
- /**
- * Creates a client proxy based on the given WSDL information. If the
- * service contains more than one port the first one will be used as no port
- * name is passed. The WSDL location will be obtained from Bus configuration
- * using the <code>serviceName</code>.
- *
- * @param iface The interface class implemented by the returned proxy.
- * @param serviceName The QName that identifies the service..
- * @return A proxy object that implements both the given <code>iface</code>
- * and the {@link Connection} interface. It represents the Web
- * service associated with the specified service.
- * @throws ResourceException If there is an error creating the connection.
- */
- Object getConnection(Class iface, QName serviceName) throws ResourceException;
-
+ Object getConnection(CXFConnectionParam param) throws ResourceException;
+
+
/**
* Returns the underlying {@link Bus} for this connection factory. In some
* J2EE environments, for example Weblogic, the {@link Bus} and dependent
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/logging/LoggerHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/logging/LoggerHelper.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/logging/LoggerHelper.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/logging/LoggerHelper.java Thu Oct 25 10:09:20 2007
@@ -18,20 +18,23 @@
*/
package org.apache.cxf.jca.core.logging;
-import java.io.*;
+import java.io.Writer;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
-import java.util.logging.LogManager;
import java.util.logging.Logger;
+import org.apache.cxf.common.logging.Log4jLogger;
+import org.apache.cxf.common.logging.LogUtils;
+
+
public final class LoggerHelper {
public static final Level DEFAULT_LOG_LEVEL = Level.WARNING;
public static final String CONSOLE_HANDLER = "ConsoleHandler";
public static final String WRITER_HANDLER = "WriterHandler";
private static String rootLoggerName = "org.apache.cxf";
private static boolean initComplete;
- private static Level currentLogLevel = Level.WARNING;;
+ private static Level currentLogLevel = Level.WARNING;
private LoggerHelper() {
//do nothing here
@@ -43,9 +46,10 @@
// jboss writer will redirect to log4j which will cause an
// infinite loop if we install an appender over this writer.
// Continue logging via log4j and ignore this writer.
- //
+ LogUtils.setLoggerClass(Log4jLogger.class);
return;
}
+
Logger cxfLogger = getRootCXFLogger();
// test if the stream handler were setted
@@ -53,8 +57,7 @@
final WriterHandler handler = new WriterHandler(writer);
cxfLogger.addHandler(handler);
}
- // log just to the print writer
- disableConsoleLogging();
+
}
}
@@ -70,8 +73,8 @@
// true if log output is already going somewhere
public static boolean loggerInitialisedOutsideConnector() {
- final Handler[] handlers = Logger.getLogger("").getHandlers();
- return handlers.length > 0;
+ final Handler[] handlers = getConsoleLogger().getHandlers(); //NOPMD
+ return handlers != null && handlers.length > 0;
}
static Handler getHandler(Logger log, String handlerName) {
@@ -86,14 +89,14 @@
}
public static void disableConsoleLogging() {
- final Handler handler = getHandler(Logger.getLogger(""), CONSOLE_HANDLER);
- Logger.getLogger("").removeHandler(handler);
+ final Handler handler = getHandler(getConsoleLogger(), CONSOLE_HANDLER); //NOPMD
+ getConsoleLogger().removeHandler(handler); //NOPMD
}
public static void enableConsoleLogging() {
- if (getHandler(Logger.getLogger(""), CONSOLE_HANDLER) == null) {
- final ConsoleHandler console = new ConsoleHandler();
- Logger.getLogger("").addHandler(console);
+ if (getHandler(getConsoleLogger(), CONSOLE_HANDLER) == null) { //NOPMD
+ final Handler console = new ConsoleHandler();
+ getConsoleLogger().addHandler(console); //NOPMD
}
}
@@ -112,13 +115,11 @@
}
public static Logger getRootCXFLogger() {
- Logger rootCXFLogger = null;
- rootCXFLogger = LogManager.getLogManager().getLogger(getRootLoggerName());
- if (rootCXFLogger == null) {
- rootCXFLogger = Logger.getLogger(getRootLoggerName());
- }
-
- return rootCXFLogger;
+ return LogUtils.getLogger(LoggerHelper.class, null, getRootLoggerName());
+ }
+
+ public static Logger getConsoleLogger() {
+ return LogUtils.getLogger(LoggerHelper.class, null, "");
}
public static void init() {
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionFactoryImpl.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionFactoryImpl.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionFactoryImpl.java Thu Oct 25 10:09:20 2007
@@ -80,11 +80,11 @@
crInfo});
if (!((AbstractManagedConnectionImpl)conn).isBound()) {
- LOG.fine("match against unbounded, con= " + conn + ", info=" + crInfo);
+ LOG.fine("Match against unbounded, con= " + conn + ", info=" + crInfo);
return conn;
} else {
if (isMatch(conn, crInfo, subject)) {
- LOG.fine("match against bounded, con= " + conn + ", info=" + crInfo);
+ LOG.fine("Match against bounded, con= " + conn + ", info=" + crInfo);
return conn;
}
@@ -94,24 +94,18 @@
return null;
}
- private boolean isMatch(final AbstractManagedConnectionImpl canditateConn,
+ private boolean isMatch(final AbstractManagedConnectionImpl candidateConn,
final ConnectionRequestInfo crInfo, final Subject subject)
throws ResourceAdapterInternalException {
boolean result = false;
- final ConnectionRequestInfo canditate = canditateConn.getConnectionRequestInfo();
+ final ConnectionRequestInfo candidate = candidateConn.getConnectionRequestInfo();
- if (canditate.equals(crInfo)) {
- LOG.fine("found match canditate=" + canditate + ", info=" + crInfo);
- LOG.fine("Checking Subjects Match " + subject + " " + canditateConn.getSubject());
-
- if ((subject == null)
- || (subject.equals(((AbstractManagedConnectionImpl)canditateConn).getSubject()))) {
- try {
- validateReference(canditateConn, subject);
- result = true;
- } catch (Exception thrown) {
- result = false;
- }
+ if (candidate.equals(crInfo) && (subject == null || subject.equals(candidateConn.getSubject()))) {
+ try {
+ validateReference(candidateConn, subject);
+ result = true;
+ } catch (Exception thrown) {
+ result = false;
}
}
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java Thu Oct 25 10:09:20 2007
@@ -23,7 +23,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import javax.resource.NotSupportedException;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEvent;
import javax.resource.spi.ConnectionEventListener;
@@ -33,6 +32,7 @@
import javax.security.auth.Subject;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.jca.core.logging.LoggerHelper;
+import org.apache.cxf.jca.cxf.CXFManagedConnectionMetaData;
public abstract class AbstractManagedConnectionImpl implements ManagedConnection {
private static final Logger LOG = LogUtils.getL7dLogger(AbstractManagedConnectionImpl.class);
@@ -73,10 +73,9 @@
public abstract boolean isBound();
public void close(Object closingHandle) throws ResourceException {
- LOG.fine("closing handle: " + closingHandle);
+ LOG.fine("Closing handle: " + closingHandle);
ConnectionEvent coEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
-
coEvent.setConnectionHandle(closingHandle);
sendEvent(coEvent);
}
@@ -102,7 +101,7 @@
}
public ManagedConnectionMetaData getMetaData() throws ResourceException {
- throw new NotSupportedException("NOT_YET_IMPLEMENTED getMetaData");
+ return new CXFManagedConnectionMetaData();
}
public void setLogWriter(PrintWriter aPrintWriter) throws ResourceException {
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/Handler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/Handler.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/Handler.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/Handler.java Thu Oct 25 10:09:20 2007
@@ -33,7 +33,6 @@
private static final Logger LOG = LogUtils.getL7dLogger(Handler.class);
public URLConnection openConnection(URL someUrl) {
- LOG.fine("URL=" + someUrl);
return new URLConnection(someUrl) {
public void connect() {
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceBean.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceBean.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceBean.java Thu Oct 25 10:09:20 2007
@@ -42,8 +42,9 @@
public static final String DEFAULT_MONITOR_POLL_INTERVAL = "120";
public static final String EJB_SERVICE_PROPERTIES_URL = "ejb.service.properties.url";
public static final String MONITOR_EJB_SERVICE_PROPERTIES = "monitor.ejb.service.properties";
- public static final String MONITOR_POLL_INTERVAL = "monitor.poll.interval";
- private static final long serialVersionUID = -9186743162164946039L;
+ public static final String MONITOR_POLL_INTERVAL = "monitor.poll.interval";
+ public static final String EJB_SERVANT_BASE_URL = "ejb.servant.base.url";
+
static {
// first use of log, default init if necessary
@@ -74,7 +75,7 @@
public void setProperty(String propName, String propValue) {
if (!DEFAULT_VALUE_STRING.equals(propValue)) {
- LOG.log(Level.CONFIG, "SETTING_PROPERTY", new Object[] {propName, propValue});
+ LOG.log(Level.FINE, "SETTING_PROPERTY", new Object[] {propName, propValue});
getPluginProps().setProperty(propName, propValue);
}
if (LOG_LEVEL.equals(propName)) {
@@ -104,7 +105,7 @@
try {
url = createURL(spec, msg);
url.openStream();
- LOG.config("Validated url=" + url);
+ LOG.fine("Validated url=" + url);
} catch (IOException ioe) {
throw new ResourceAdapterInternalException(msg, ioe);
}
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/AssociatedManagedConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/AssociatedManagedConnectionFactoryImpl.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/AssociatedManagedConnectionFactoryImpl.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/AssociatedManagedConnectionFactoryImpl.java Thu Oct 25 10:09:20 2007
@@ -34,19 +34,15 @@
public class AssociatedManagedConnectionFactoryImpl
extends ManagedConnectionFactoryImpl implements ResourceAdapterAssociation {
- private static final Logger LOG =
- LogUtils.getL7dLogger(AssociatedManagedConnectionFactoryImpl.class);
+ private static final Logger LOG = LogUtils.getL7dLogger(AssociatedManagedConnectionFactoryImpl.class);
private ResourceAdapter ra;
public AssociatedManagedConnectionFactoryImpl() {
super();
- LOG.info("AssociatedManagedConnectionFactoryImpl constructed without props by appserver...");
}
public AssociatedManagedConnectionFactoryImpl(Properties props) {
super(props);
- LOG.info("AssociatedManagedConnectionFactoryImpl constructed with props by appserver."
- + " props = " + props);
}
public Object createConnectionFactory(ConnectionManager connMgr) throws ResourceException {
@@ -68,7 +64,11 @@
public ResourceAdapter getResourceAdapter() {
return ra;
}
-
+
+ /**
+ * If outbound-resourceAdapter and the resourceAdapter has same property,
+ * the outbound-resourceAdapter property's value would take precedence.
+ */
protected void mergeResourceAdapterProps() {
Properties raProps = ((ResourceAdapterImpl)ra).getPluginProps();
Properties props = getPluginProps();
@@ -78,8 +78,7 @@
if (!props.containsKey(key)) {
setProperty(key, raProps.getProperty(key));
} else {
- LOG.info("ManagedConnectionFactory's props already contains "
- + key + ". No need to merge");
+ LOG.fine("ManagedConnectionFactory's props already contain [" + key + "]. No need to merge");
}
}
}
@@ -95,7 +94,18 @@
protected Object getBootstrapContext() {
return ((ResourceAdapterImpl)ra).getBootstrapContext();
}
+
+ //Explicit override these two methods,
+ //otherwise when deploy rar to weblogic9.1, it would complaint about this.
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ public boolean equals(Object o) {
+ return super.equals(o);
+ }
}
+
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFConnectionRequestInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFConnectionRequestInfo.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFConnectionRequestInfo.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFConnectionRequestInfo.java Thu Oct 25 10:09:20 2007
@@ -20,75 +20,22 @@
import java.net.URL;
+
import javax.resource.spi.ConnectionRequestInfo;
import javax.xml.namespace.QName;
+import org.apache.cxf.connector.CXFConnectionParam;
-public class CXFConnectionRequestInfo implements ConnectionRequestInfo {
- private Class iface;
- private URL wsdlLocation;
- private QName serviceName;
- private QName portName;
+public class CXFConnectionRequestInfo extends CXFConnectionParam implements ConnectionRequestInfo {
+
+ public CXFConnectionRequestInfo() {
+ super();
+ }
+
public CXFConnectionRequestInfo(Class aIface, URL aWsdlLocation,
QName aServiceName, QName aPortName) {
- this.iface = aIface;
- this.wsdlLocation = aWsdlLocation;
- this.serviceName = aServiceName;
- this.portName = aPortName;
- }
-
- public Class<?> getInterface() {
- return iface;
- }
-
- public URL getWsdlLocationUrl() {
- return wsdlLocation;
+ super(aIface, aWsdlLocation, aServiceName, aPortName);
}
-
- public QName getServiceQName() {
- return serviceName;
- }
-
- public QName getPortQName() {
- return portName;
- }
-
-
-
- public boolean equals(java.lang.Object other) {
- boolean ret = this == other;
-
- if (!ret && other instanceof CXFConnectionRequestInfo) {
- CXFConnectionRequestInfo cri = (CXFConnectionRequestInfo)other;
-
- ret = areEquals(iface, cri.iface) && areEquals(wsdlLocation, cri.wsdlLocation)
- && areEquals(serviceName, cri.serviceName) && areEquals(portName, cri.portName);
-
- }
- return ret;
- }
-
- public int hashCode() {
- return getInterface().hashCode() + (serviceName != null ? serviceName.hashCode() : 0);
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer(256);
-
- buf.append(iface).append(":").append(portName).append(":").append(serviceName).append("@").append(
- wsdlLocation);
-
- return buf.toString();
- }
-
-
- private boolean areEquals(Object obj1, Object obj2) {
- if (obj1 == null) {
- return obj1 == obj2;
- } else {
- return obj1.equals(obj2);
- }
- }
-
+
}
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFInvocationHandler.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFInvocationHandler.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/CXFInvocationHandler.java Thu Oct 25 10:09:20 2007
@@ -22,7 +22,8 @@
public interface CXFInvocationHandler extends InvocationHandler {
- void setNext(CXFInvocationHandler next);
+ void setNext(CXFInvocationHandler next);
+
CXFInvocationHandler getNext();
CXFInvocationHandlerData getData();
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ConnectionFactoryImpl.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ConnectionFactoryImpl.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ConnectionFactoryImpl.java Thu Oct 25 10:09:20 2007
@@ -20,8 +20,7 @@
import java.io.Serializable;
-import java.net.URL;
-import java.util.logging.Logger;
+import java.util.ResourceBundle;
import javax.naming.NamingException;
import javax.naming.Reference;
@@ -30,17 +29,17 @@
import javax.resource.spi.ConnectionManager;
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.ManagedConnectionFactory;
-import javax.xml.namespace.QName;
-
-import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.connector.CXFConnectionFactory;
+import org.apache.cxf.connector.CXFConnectionParam;
import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
public class ConnectionFactoryImpl implements CXFConnectionFactory,
Referenceable,
Serializable {
- private static final Logger LOG = LogUtils.getL7dLogger(ConnectionFactoryImpl.class);
+ private static final ResourceBundle BUNDLE = BundleUtils.getBundle(ConnectionFactoryImpl.class);
private ManagedConnectionFactory managedConnectionFactory;
private ConnectionManager connectionManager;
private Reference reference;
@@ -48,50 +47,35 @@
public ConnectionFactoryImpl(ManagedConnectionFactory aMCF, ConnectionManager aCM) {
managedConnectionFactory = aMCF;
connectionManager = aCM;
- LOG.info("this=" + this);
}
public void setReference(Reference ref) {
- LOG.info("Reference : " + ref + " is set");
reference = ref;
}
public Reference getReference() throws NamingException {
- LOG.info("Reference : " + reference + " is returned");
return reference;
}
- public Object getConnection(Class iface, URL wsdlLocation, QName serviceName) throws ResourceException {
- return getConnection(iface, wsdlLocation, serviceName, null);
- }
-
- public Object getConnection(Class iface, QName serviceName, QName portName) throws ResourceException {
- return getConnection(iface, null, serviceName, portName);
- }
-
- public Object getConnection(Class iface, QName serviceName) throws ResourceException {
- return getConnection(iface, null, serviceName, null);
- }
public Object getBus() {
return ((ManagedConnectionFactoryImpl)managedConnectionFactory).getBus();
}
- public Object getConnection(Class iface, URL wsdlLocation, QName serviceName, QName portName)
- throws ResourceException {
+ public Object getConnection(CXFConnectionParam param) throws ResourceException {
- if (!iface.isInterface()) {
- throw new ResourceAdapterInternalException(
- "The first argument to getConnection must be an Interface",
- new IllegalArgumentException(iface.toString() + " is not an Interface."));
+ if (param.getInterface() == null) {
+ throw new ResourceAdapterInternalException(new Message("INTERFACE_IS_NULL", BUNDLE).toString());
}
-
- LOG.info("connecting to: " + iface);
-
- CXFConnectionRequestInfo reqInfo =
- new CXFConnectionRequestInfo(iface, wsdlLocation, serviceName, portName);
-
+
+ if (!param.getInterface().isInterface()) {
+ throw new ResourceAdapterInternalException(new Message("IS_NOT_AN_INTERFACE",
+ BUNDLE, param.getInterface()).toString());
+ }
+
+ CXFConnectionRequestInfo reqInfo = (CXFConnectionRequestInfo) param;
+
if (connectionManager == null) {
// non-managed, null Subject
ManagedConnection connection = managedConnectionFactory.createManagedConnection(null, reqInfo);
@@ -100,21 +84,7 @@
return connectionManager.allocateConnection(managedConnectionFactory, reqInfo);
}
}
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+}
Modified: incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java (original)
+++ incubator/cxf/branches/jliu/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java Thu Oct 25 10:09:20 2007
@@ -21,67 +21,43 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.InetAddress;
import java.net.URL;
-import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
-import java.util.StringTokenizer;
+import java.util.ResourceBundle;
import java.util.logging.Logger;
-import javax.ejb.EJBHome;
-import javax.ejb.EJBObject;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
import javax.resource.ResourceException;
-import javax.rmi.PortableRemoteObject;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.work.Work;
+import javax.resource.spi.work.WorkManager;
import org.apache.cxf.Bus;
-import org.apache.cxf.BusException;
import org.apache.cxf.BusFactory;
-import org.apache.cxf.binding.BindingFactoryManager;
-import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.PackageUtils;
import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.jaxb.JAXBDataBinding;
-import org.apache.cxf.jaxws.JAXWSMethodInvoker;
-import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
import org.apache.cxf.jca.core.resourceadapter.UriHandlerInit;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.transport.ConduitInitiatorManager;
-import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.transport.http.AbstractHTTPTransportFactory;
-import org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory;
-import org.apache.cxf.wsdl.WSDLManager;
-import org.apache.cxf.wsdl11.WSDLManagerImpl;
+import org.apache.cxf.jca.servant.EJBEndpoint;
+import org.apache.cxf.jca.servant.EJBServantConfig;
public class JCABusFactory {
private static final Logger LOG = LogUtils.getL7dLogger(JCABusFactory.class);
-
+
+ private static final ResourceBundle BUNDLE = BundleUtils.getBundle(JCABusFactory.class);
+
private Bus bus;
- private BusFactory bf;
private List<Server> servantsCache = new ArrayList<Server>();
- private InitialContext jndiContext;
private ClassLoader appserverClassLoader;
private ManagedConnectionFactoryImpl mcf;
private Object raBootstrapContext;
+
public JCABusFactory(ManagedConnectionFactoryImpl aMcf) {
this.mcf = aMcf;
@@ -90,64 +66,17 @@
protected String[] getBusArgs() throws ResourceException {
//There is only setting up the BUSID
String busId = mcf.getConfigurationScope();
- LOG.config("BUSid=" + busId);
String busArgs[] = new String[2];
busArgs[0] = "-BUSid";
busArgs[1] = busId;
return busArgs;
- }
-
- protected Bus createBus(ClassLoader loader) throws ResourceException {
- try {
- //REVISIT we need to use the CXF defualt BusFactory
- bf = org.apache.cxf.BusFactory.newInstance(getBusClassName());
- bus = bf.createBus();
- } catch (Exception ex) {
- throw new ResourceAdapterInternalException("Failed to initialize cxf runtime", ex);
- }
-
- return bus;
- }
-
- protected void initBus() throws ResourceException {
- //REVISIT The Bus need to be init with context for better configuration
- try {
- SoapBindingFactory bindingFactory = new SoapBindingFactory();
- bus.getExtension(BindingFactoryManager.class)
- .registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
-
- DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-
- SoapTransportFactory soapDF = new SoapTransportFactory();
- soapDF.setBus(bus);
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
-
- AbstractHTTPTransportFactory httpTransport = new JettyHTTPTransportFactory();
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/http", httpTransport);
- //dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", httpTransport);
- //dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", httpTransport);
-
- ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
- //extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, httpTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http", httpTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/http/http", httpTransport);
- //extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/", httpTransport);
-
- bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);
-
- } catch (Exception ex) {
- throw new ResourceAdapterInternalException("Failed to initialize cxf runtime", ex);
- }
- }
-
-
+ }
protected synchronized void init() throws ResourceException {
- LOG.config("initialising... the bus");
+
+ LOG.info("Initializing the CXF Bus ...");
new UriHandlerInit();
-
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
ClassLoader cl = this.getClass().getClassLoader();
@@ -157,17 +86,16 @@
//TODO Check for the managed connection factory properties
//TODO We may need get the configuration file from properties
- //mcf.validateProperties();
- bus = createBus(cl);
- initBus();
- initialiseServants();
+ BusFactory bf = BusFactory.newInstance();
+ bus = bf.createBus();
+ initializeServants();
} catch (Exception ex) {
if (ex instanceof ResourceAdapterInternalException) {
throw (ResourceException)ex;
} else {
- ex.printStackTrace();
- throw new ResourceAdapterInternalException("Failed to initialize connector runtime", ex);
+ throw new ResourceAdapterInternalException(
+ new Message("FAIL_TO_INITIALIZE_JCABUSFACTORY", BUNDLE).toString(), ex);
}
} finally {
Thread.currentThread().setContextClassLoader(original);
@@ -175,211 +103,72 @@
}
- void initialiseServants() throws ResourceException {
+ protected void initializeServants() throws ResourceException {
if (isMonitorEJBServicePropertiesEnabled()) {
- LOG.info("ejb service properties update enabled. ");
- startPropertiesMonitorThread();
+ LOG.info("Ejb service properties auto-detect enabled. ");
+ startPropertiesMonitorWorker();
} else {
URL propsUrl = mcf.getEJBServicePropertiesURLInstance();
if (propsUrl != null) {
- initialiseServantsFromProperties(loadProperties(propsUrl), false);
+ initializeServantsFromProperties(loadProperties(propsUrl));
}
}
}
- void initialiseServantsFromProperties(Properties ejbServants, boolean abortOnFailure)
- throws ResourceException {
- // Props format: jndi name = service string
- //
- // java:/ejbs/A={http:/a/b/b}SoapService@http://localost:wsdls/a.wsdl
-
- try {
- jndiContext = new InitialContext();
- } catch (NamingException ne) {
- throw new ResourceAdapterInternalException(
- "Failed to construct InitialContext for EJBServant(s) jndi lookup, reason: "
- + ne, ne);
- }
-
+ private void initializeServantsFromProperties(Properties ejbServants) throws ResourceException {
+
deregisterServants(bus);
-
- LOG.config("Initialising EJB endpoints...");
-
- Enumeration keys = ejbServants.keys();
-
- while (keys.hasMoreElements()) {
- String jndiName = (String)keys.nextElement();
- String serviceName = (String)ejbServants.getProperty(jndiName);
- LOG.config("Found ejb endpoint: jndi name=" + jndiName + ", wsdl service=" + serviceName);
-
- try {
- initialiseServant(jndiName, serviceName);
- } catch (ResourceException re) {
- LOG.warning("Error initialising servant with jndi name "
- + jndiName + " and service name "
- + serviceName + " Exception:"
- + re.getMessage());
- if (abortOnFailure) {
- throw re;
- }
- }
- }
- }
-
- void initialiseServant(String jndiName, String serviceName) throws ResourceException {
-
- Server servant = null;
- EJBObject ejb = null;
- QName serviceQName = null;
- String nameSpace = "";
- String interfaceName = "";
- String packageName = "";
- Class interfaceClass = null;
- ClassLoader ejbClassLoader = null;
- ClassLoader currentThreadContextClassLoader = null;
- try {
- if ("".equals(serviceName)) {
- throw new ResourceAdapterInternalException(
- "A WSDL service QName must be specified as the value of the EJB JNDI name key: "
- + jndiName);
- } else {
- serviceQName = serviceQNameFromString(serviceName);
-
- serviceQNameFromString(serviceName);
-
- // Get ejbObject
- ejb = getEJBObject(jndiName);
- ejbClassLoader = ejb.getClass().getClassLoader();
-
- //NOTE we can use the ejbClassLoader to load WSDL
- currentThreadContextClassLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(ejbClassLoader);
-
- Thread.currentThread().setContextClassLoader(currentThreadContextClassLoader);
-
- nameSpace = serviceQName.getNamespaceURI();
- packageName = PackageUtils.parsePackageName(nameSpace, null);
-
- // Get interface of ejbObject
- interfaceName = jndiName.substring(0, jndiName.length() - 4);
- interfaceName = packageName + "." + interfaceName;
-
- interfaceClass = Class.forName(interfaceName);
-
- // NOTE We can check the annoation to descide which kind of frontend we will use
- // Almostly we just need to use the jax-ws frontend
- // If we have wsdl , then wsdl first,
- // else code first
+ LOG.info("Initializing EJB endpoints from properties file...");
+
+ try {
+ Enumeration keys = ejbServants.keys();
+ while (keys.hasMoreElements()) {
+ String theJNDIName = (String)keys.nextElement();
+ String value = (String)ejbServants.get(theJNDIName);
+ EJBServantConfig config = new EJBServantConfig(theJNDIName, value);
+ EJBEndpoint ejbEndpoint = new EJBEndpoint(config);
+ ejbEndpoint.setEjbServantBaseURL(mcf.getEJBServantBaseURL());
+ ejbEndpoint.setWorkManager(getWorkManager());
+ Server servant = ejbEndpoint.publish();
- servant = publishServantWithoutWSDL(ejb, jndiName, nameSpace, interfaceClass);
+ synchronized (servantsCache) {
+ if (servant != null) {
+ servantsCache.add(servant);
+ }
+ }
}
} catch (Exception e) {
- throw new ResourceAdapterInternalException(e.getMessage());
- }
- synchronized (servantsCache) {
- if (servant != null) {
- servantsCache.add(servant);
- }
- }
- }
-
- public Server publishServantWithoutWSDL(EJBObject ejb, String jndiName,
- String nameSpace, Class interfaceClass)
- throws Exception {
-
- String hostName = "";
- try {
- InetAddress addr = InetAddress.getLocalHost();
- //hostName = addr.getHostName();
- hostName = addr.getCanonicalHostName();
- } catch (UnknownHostException e) {
e.printStackTrace();
+ throw new ResourceException(new Message("FAIL_TO_START_EJB_SERVANTS", BUNDLE).toString(), e);
}
- String address = "http://" + hostName + ":9999/" + jndiName;
-
- ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
- Service service = createService(interfaceClass, bean);
-
- // REVISIT this is easy to be replace by EJBMethodInvoker
- service.setInvoker(new JAXWSMethodInvoker(ejb));
-
- ServerFactoryBean svrFactory = new ServerFactoryBean();
-
- return createServer(svrFactory, bean, address);
-
-
- }
-
- protected Service createService(Class interfaceClass, ReflectionServiceFactoryBean serviceFactory)
- throws JAXBException {
- serviceFactory.setDataBinding(new JAXBDataBinding());
- serviceFactory.setBus(bus);
- serviceFactory.setServiceClass(interfaceClass);
- Map<String, Object> props = new HashMap<String, Object>();
- props.put("test", "test");
- serviceFactory.setProperties(props);
-
- return serviceFactory.create();
- }
-
- protected Server createServer(ServerFactoryBean serverFactory,
- ReflectionServiceFactoryBean serviceFactory,
- String address) {
- serverFactory.setAddress(address);
- serverFactory.setTransportId("http://schemas.xmlsoap.org/soap/http");
- serverFactory.setServiceFactory(serviceFactory);
- serverFactory.setBus(bus);
-
- return serverFactory.create();
- }
-
- private EJBObject getEJBObject(String jndi) throws BusException {
- try {
- EJBHome home = getEJBHome(jndiContext, jndi);
-
-// ejbHomeClassLoader = home.getClass().getClassLoader();
-
- Method createMethod = home.getClass().getMethod("create", new Class[0]);
-
- return (EJBObject) createMethod.invoke(home, new Object[0]);
- } catch (NamingException e) {
- throw new BusException(e);
- } catch (NoSuchMethodException e) {
- throw new BusException(e);
- } catch (IllegalAccessException e) {
- throw new BusException(e);
- } catch (InvocationTargetException itex) {
- Throwable thrownException = itex.getTargetException();
- throw new BusException(thrownException);
- }
}
- protected EJBHome getEJBHome(Context ejbContext, String jndiName) throws NamingException {
- Object obj = ejbContext.lookup(jndiName);
- return (EJBHome) PortableRemoteObject.narrow(obj, EJBHome.class);
- }
- void startPropertiesMonitorThread() throws ResourceException {
+ private void startPropertiesMonitorWorker() throws ResourceException {
Integer pollIntervalInteger = mcf.getEJBServicePropertiesPollInterval();
int pollInterval = pollIntervalInteger.intValue();
- LOG.info("ejb service properties poll interval is : " + pollInterval + " seconds");
- EJBServicePropertiesMonitorRunnable r = new EJBServicePropertiesMonitorRunnable(pollInterval);
- Thread t = new Thread(r);
- t.setDaemon(true);
- t.start();
+
+ LOG.info("Ejb service properties poll interval is: [" + pollInterval + " seconds]");
+
+ EJBServicePropertiesMonitorWorker worker = new EJBServicePropertiesMonitorWorker(pollInterval);
+ if (getWorkManager() != null) {
+ getWorkManager().startWork(worker, CXFWorkAdapter.DEFAULT_START_TIME_OUT, null, worker);
+ } else {
+ Thread t = new Thread(worker);
+ t.setDaemon(true);
+ t.start();
+ }
}
- boolean isMonitorEJBServicePropertiesEnabled() throws ResourceException {
+ private boolean isMonitorEJBServicePropertiesEnabled() throws ResourceException {
boolean retVal = false;
if (mcf.getMonitorEJBServiceProperties().booleanValue()) {
URL url = mcf.getEJBServicePropertiesURLInstance();
if (url == null) {
throw new ResourceAdapterInternalException(
- "MonitorEJBServiceProperties property is set to true,"
- + " but EJBServicePropertiesURL is not set. "
- + "Both properties must be set to enable monitoring.");
+ new Message("EJB_SERVANT_PROPERTIES_IS_NULL", BUNDLE).toString());
}
retVal = isFileURL(url);
}
@@ -391,20 +180,18 @@
return url != null && "file".equals(url.getProtocol());
}
- protected void deregisterServants(Bus aBus) {
+ private void deregisterServants(Bus aBus) {
synchronized (servantsCache) {
- if (!servantsCache.isEmpty()) {
- Iterator<Server> servants = servantsCache.iterator();
- while (servants.hasNext()) {
- Server servant = servants.next();
- servant.stop();
- }
- servantsCache.clear();
+ for (Server servant : servantsCache) {
+ //REVISIT: seems using server.stop() doesn't release resource properly.
+ servant.stop();
+ LOG.info("Shutdown the EJB Endpoint: " + servant.getEndpoint().getEndpointInfo().getName());
}
+ servantsCache.clear();
}
}
- Properties loadProperties(URL propsUrl) throws ResourceException {
+ protected Properties loadProperties(URL propsUrl) throws ResourceException {
Properties props = null;
InputStream istream = null;
@@ -412,112 +199,24 @@
try {
istream = propsUrl.openStream();
- } catch (IOException ioe) {
- throw new ResourceAdapterInternalException("Failed to openStream to URL, value=" + propsUrl
- + ", reason:" + ioe, ioe);
- }
-
- try {
props = new Properties();
props.load(istream);
- } catch (IOException ioe) {
- props = null;
- throw new ResourceAdapterInternalException("Failed to load properties from " + propsUrl, ioe);
+ } catch (IOException e) {
+ throw new ResourceAdapterInternalException(
+ new Message("FAIL_TO_LOAD_EJB_SERVANT_PROPERTIES", BUNDLE, propsUrl).toString(), e);
} finally {
- try {
- istream.close();
- } catch (IOException ignored) {
- //do nothing here
- }
- }
-
- return props;
- }
-
- QName serviceQNameFromString(String qns) throws ResourceAdapterInternalException {
- String lp = null;
- String nameSpace = null;
-
- // String re = "(\[(.*)\])?([^\@]+)(@?(.*))??";
- // String[] qna = qns.split("(\[?+[^\]]*\])([^@])@?+(.*)");
-
- try {
- StringTokenizer st = new StringTokenizer(qns, "{},@", true);
- while (st.hasMoreTokens()) {
- String t = st.nextToken();
- if ("{".equals(t)) {
- nameSpace = st.nextToken();
- st.nextToken();
- // consume '}'
- } else if (",".equals(t)) {
- st.nextToken();
- // consume 'portName'
- } else if ("@".equals(t)) {
- st.nextToken();
- // consume 'wsdlLoc'
- } else {
- lp = t;
+ if (istream != null) {
+ try {
+ istream.close();
+ } catch (IOException e) {
+ //DO Nothing
}
}
- } catch (java.util.NoSuchElementException nsee) {
- throw new ResourceAdapterInternalException(
- "Incomplete QName, string is not in expected format: "
- + "[{namespace}]local part[@ wsdl location url]. value:"
- + qns, nsee);
}
- LOG.fine("QN=" + qns + ", ns=" + nameSpace + ", lp=" + lp);
- return new QName(nameSpace, lp);
- }
-
- String portNameFromString(String qns) throws ResourceAdapterInternalException {
- String portName = null;
- try {
- StringTokenizer st = new StringTokenizer(qns, ",@", true);
- while (st.hasMoreTokens()) {
- String t = st.nextToken();
- if (",".equals(t)) {
- if (portName != null) {
- throw new ResourceAdapterInternalException(
- "portName already set, string is not in expected format:"
- + " [{namespace}]serviceName[,portName][@ wsdl location url]. value:"
- + qns);
- }
-
- portName = st.nextToken();
-
- if ("@".equals(portName)) {
- throw new ResourceAdapterInternalException(
- "Empty portName, string is not in expected format: "
- + "[{namespace}]serviceName[,portName][@ wsdl location url]. value:"
- + qns);
- }
- }
- }
- } catch (java.util.NoSuchElementException nsee) {
- throw new ResourceAdapterInternalException(
- "Incomplete QName, string is not in expected format: "
- + "[{namespace}]serviceName[,portName][@ wsdl location url]. value:"
- + qns, nsee);
- }
- return portName;
- }
- String wsdlLocFromString(String qns) {
- String wloc = null;
- StringTokenizer st = new StringTokenizer(qns, "@", true);
- while (st.hasMoreTokens()) {
- String t = st.nextToken();
- if ("@".equals(t)) {
- wloc = st.nextToken();
- }
- }
- return wloc;
+ return props;
}
-
- private String getBusClassName() {
- return System.getProperty("test.bus.class", "org.apache.cxf.bus.spring.SpringBusFactory");
- }
protected List getRegisteredServants() {
return servantsCache;
@@ -531,10 +230,6 @@
this.appserverClassLoader = classLoader;
}
- public InitialContext getInitialContext() {
- return jndiContext;
- }
-
public Object getBootstrapContext() {
return raBootstrapContext;
}
@@ -553,13 +248,15 @@
init();
}
- class EJBServicePropertiesMonitorRunnable implements Runnable {
+ private class EJBServicePropertiesMonitorWorker extends CXFWorkAdapter implements Work {
private long previousModificationTime;
private final int pollIntervalSeconds;
private final File propsFile;
- private boolean continuing = true;
+
+ //The release() method will be called on separate thread while the run() is processing.
+ private volatile boolean continuing = true;
- EJBServicePropertiesMonitorRunnable(int pollInterval) throws ResourceException {
+ EJBServicePropertiesMonitorWorker(int pollInterval) throws ResourceException {
pollIntervalSeconds = pollInterval;
propsFile = new File(mcf.getEJBServicePropertiesURLInstance().getPath());
}
@@ -572,19 +269,22 @@
do {
try {
if (isPropertiesFileModified()) {
- LOG.info("ejbServicePropertiesFile modified, initialising/updating servants");
- initialiseServantsFromProperties(loadProperties(propsFile.toURI().toURL()), false);
+ LOG.info("ejbServicePropertiesFile modified, initializing/updating servants");
+ initializeServantsFromProperties(loadProperties(propsFile.toURI().toURL()));
}
Thread.sleep(pollIntervalSeconds * 1000);
} catch (Exception e) {
LOG.info("MonitorThread: failed to initialiseServantsFromProperties "
- + "with properties absolute path="
- + propsFile.getAbsolutePath() + ", reason: " + e.toString());
+ + "with properties absolute path=" + propsFile.getAbsolutePath());
}
} while (continuing);
}
+
+ public void release() {
+ this.continuing = false;
+ }
- protected boolean isPropertiesFileModified() throws ResourceException {
+ protected boolean isPropertiesFileModified() {
boolean fileModified = false;
if (propsFile.exists()) {
long currentModificationTime = propsFile.lastModified();
@@ -601,6 +301,16 @@
protected void setBootstrapContext(Object ctx) {
raBootstrapContext = ctx;
}
+
+ public WorkManager getWorkManager() {
+ if (getBootstrapContext() instanceof BootstrapContext) {
+ BootstrapContext context = (BootstrapContext)getBootstrapContext();
+ return context.getWorkManager();
+ }
+ return null;
+ }
+
+
}