Author: richard.opalka(a)jboss.com
Date: 2009-10-15 19:06:37 -0400 (Thu, 15 Oct 2009)
New Revision: 10922
Added:
stack/native/trunk/eclipse/jboss-format.xml
stack/native/trunk/eclipse/jboss-style.xml
stack/native/trunk/modules/client/src/main/resources/META-INF/services/
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
Removed:
stack/native/trunk/eclipse/JBossWSCheckStyle.xml
stack/native/trunk/eclipse/JBossWSCodeStyle.xml
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointRegistryFactoryImpl.java
stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
Modified:
stack/native/trunk/modules/core/pom.xml
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/AddressingTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
stack/native/trunk/modules/testsuite/pom.xml
Log:
merge from ropalka branch
Deleted: stack/native/trunk/eclipse/JBossWSCheckStyle.xml
===================================================================
--- stack/native/trunk/eclipse/JBossWSCheckStyle.xml 2009-10-15 23:02:53 UTC (rev 10921)
+++ stack/native/trunk/eclipse/JBossWSCheckStyle.xml 2009-10-15 23:06:37 UTC (rev 10922)
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- This configuration file was written by the eclipse-cs plugin configuration editor
--->
-<!--
- Checkstyle-Configuration: JBossWS Checks
- Description: JBossWS Java Coding Convention Checks
--->
-<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
-<module name="Checker">
- <property name="severity" value="warning"/>
- <module name="TreeWalker">
- <module name="ModifierOrder"/>
- <module name="RedundantModifier"/>
- <module name="AnonInnerLength"/>
- <module name="ExecutableStatementCount">
- <property name="max" value="60"/>
- <property name="tokens"
value="INSTANCE_INIT,STATIC_INIT,METHOD_DEF,CTOR_DEF"/>
- </module>
- <module name="FileLength">
- <property name="max" value="1000"/>
- </module>
- <module name="LineLength">
- <property name="max" value="120"/>
- <property name="tabWidth" value="4"/>
- </module>
- <module name="MethodLength"/>
- <module name="ParameterNumber"/>
- <module name="AvoidStarImport"/>
- <module name="IllegalImport"/>
- <module name="ImportOrder"/>
- <module name="RedundantImport"/>
- <module name="UnusedImports"/>
- <module name="AbstractClassName"/>
- <module name="ConstantName"/>
- <module name="LocalFinalVariableName"/>
- <module name="LocalVariableName"/>
- <module name="MemberName"/>
- <module name="MethodName"/>
- <module name="PackageName"/>
- <module name="ParameterName"/>
- <module name="StaticVariableName"/>
- <module name="TypeName"/>
- <module name="CovariantEquals"/>
- <module name="DefaultComesLast"/>
- <module name="DeclarationOrder"/>
- <module name="DoubleCheckedLocking"/>
- <module name="EqualsHashCode"/>
- <module name="ExplicitInitialization"/>
- <module name="FallThrough"/>
- <module name="FinalLocalVariable"/>
- <module name="HiddenField"/>
- <module name="IllegalInstantiation"/>
- <module name="IllegalThrows"/>
- <module name="IllegalType">
- <property name="tokens"
value="METHOD_DEF,PARAMETER_DEF"/>
- </module>
- <module name="InnerAssignment"/>
- <module name="JUnitTestCase"/>
- <module name="MagicNumber">
- <property name="ignoreNumbers" value="-1, 0, 1"/>
- </module>
- <module name="MissingCtor"/>
- <module name="MissingSwitchDefault"/>
- <module name="ModifiedControlVariable"/>
- <module name="MultipleStringLiterals"/>
- <module name="MultipleVariableDeclarations"/>
- <module name="NestedIfDepth"/>
- <module name="NestedTryDepth"/>
- <module name="PackageDeclaration"/>
- <module name="ParameterAssignment"/>
- <module name="RedundantThrows">
- <property name="logLoadErrors" value="true"/>
- <property name="suppressLoadErrors" value="true"/>
- </module>
- <module name="RequireThis"/>
- <module name="ReturnCount">
- <property name="max" value="5"/>
- </module>
- <module name="SimplifyBooleanExpression"/>
- <module name="SimplifyBooleanReturn"/>
- <module name="StringLiteralEquality"/>
- <module name="SuperClone"/>
- <module name="SuperFinalize"/>
- <module name="ArrayTrailingComma"/>
- <module name="UnnecessaryParentheses"/>
- <module name="JUnitTestCase"/>
- <module name="DesignForExtension"/>
- <module name="FinalClass"/>
- <module name="HideUtilityClassConstructor"/>
- <module name="InterfaceIsType"/>
- <module name="ThrowsCount"/>
- <module name="VisibilityModifier"/>
- <module name="MutableException"/>
- <module name="EmptyBlock"/>
- <module name="LeftCurly">
- <property name="option" value="nl"/>
- <property name="maxLineLength" value="120"/>
- </module>
- <module name="RightCurly">
- <property name="option" value="alone"/>
- </module>
- <module name="EmptyForInitializerPad">
- <property name="option" value="space"/>
- </module>
- <module name="EmptyForIteratorPad">
- <property name="option" value="space"/>
- </module>
- <module name="NoWhitespaceAfter"/>
- <module name="NoWhitespaceBefore"/>
- <module name="OperatorWrap">
- <property name="option" value="eol"/>
- <property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_INSTANCEOF,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN"/>
- </module>
- <module name="MethodParamPad">
- <property name="allowLineBreaks" value="true"/>
- </module>
- <module name="ParenPad">
- <property name="option" value="space"/>
- </module>
- <module name="TabCharacter"/>
- <module name="TypecastParenPad">
- <property name="option" value="space"/>
- <property name="tokens" value="RPAREN,TYPECAST"/>
- </module>
- <module name="WhitespaceAround">
- <property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,GENERIC_START,GENERIC_END,TYPE_EXTENSION_AND,WILDCARD_TYPE"/>
- </module>
- <module name="NeedBraces"/>
- <module name="WhitespaceAfter"/>
- <module name="BooleanExpressionComplexity"/>
- <module name="ClassDataAbstractionCoupling"/>
- <module name="ClassFanOutComplexity"/>
- <module name="CyclomaticComplexity"/>
- <module name="JavaNCSS"/>
- <module name="NPathComplexity"/>
- <module name="UncommentedMain"/>
- <module name="TodoComment"/>
- <module name="TrailingComment"/>
- <module name="Indentation"/>
- <module name="FinalParameters"/>
- <module name="ArrayTypeStyle"/>
- <module name="JavadocMethod">
- <property name="allowUndeclaredRTE" value="true"/>
- <property name="logLoadErrors" value="true"/>
- </module>
- <module name="JavadocStyle"/>
- <module name="JavadocType"/>
- <module name="JavadocVariable"/>
- <module name="WriteTag"/>
- </module>
- <module name="NewlineAtEndOfFile"/>
- <module name="PackageHtml"/>
-</module>
Deleted: stack/native/trunk/eclipse/JBossWSCodeStyle.xml
===================================================================
--- stack/native/trunk/eclipse/JBossWSCodeStyle.xml 2009-10-15 23:02:53 UTC (rev 10921)
+++ stack/native/trunk/eclipse/JBossWSCodeStyle.xml 2009-10-15 23:06:37 UTC (rev 10922)
@@ -1,251 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<profiles version="10">
-<profile name="JBossWSCodeStyle" version="10">
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns"
value="false"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment"
value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression"
value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression"
value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants"
value="0"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer"
value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
value="16"/>
-<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports"
value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package"
value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field"
value="0"/>
-<setting
id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration"
value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports"
value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type"
value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method"
value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk"
value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package"
value="0"/>
-<setting
id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations"
value="1"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration"
value="end_of_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration"
value="end_of_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer"
value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block"
value="next_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case"
value="next_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration"
value="next_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant"
value="next_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration"
value="next_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration"
value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch"
value="next_line"/>
-<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration"
value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines"
value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_comments"
value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header"
value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html"
value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description"
value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter"
value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length"
value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if"
value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation"
value="2"/>
-<setting
id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer"
value="2"/>
-<setting
id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line"
value="false"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header"
value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases"
value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines"
value="false"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases"
value="true"/>
-<setting
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch"
value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size"
value="3"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional"
value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters"
value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters"
value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional"
value="insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard"
value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
value="do not insert"/>
-<setting
id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line"
value="false"/>
-<setting
id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line"
value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line"
value="false"/>
-<setting
id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line"
value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit"
value="168"/>
-<setting
id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
value="0"/>
-<setting
id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve"
value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line"
value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char"
value="space"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size"
value="3"/>
-<setting
id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations"
value="false"/>
-</profile>
-</profiles>
Copied: stack/native/trunk/eclipse/jboss-format.xml (from rev 10915,
stack/native/branches/ropalka/eclipse/jboss-format.xml)
===================================================================
--- stack/native/trunk/eclipse/jboss-format.xml (rev 0)
+++ stack/native/trunk/eclipse/jboss-format.xml 2009-10-15 23:06:37 UTC (rev 10922)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Downloaded JBoss Eclipse Format from
http://docs.jboss.org/process-guide/en/html/coding.html -->
+<profiles version="6">
+<profile name="JBoss" version="6">
+<setting id="comment_clear_blank_lines" value="false"/>
+<setting id="comment_format_comments" value="false"/>
+<setting id="comment_format_header" value="false"/>
+<setting id="comment_format_html" value="true"/>
+<setting id="comment_format_source_code" value="true"/>
+<setting id="comment_indent_parameter_description"
value="true"/>
+<setting id="comment_indent_root_tags" value="true"/>
+<setting id="comment_line_length" value="80"/>
+<setting id="comment_new_line_for_parameter" value="true"/>
+<setting id="comment_separate_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if"
value="52"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression"
value="48"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration"
value="64"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
value="64"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field"
value="1"/>
+<setting
id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration"
value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package"
value="0"/>
+<setting
id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations"
value="1"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer"
value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case"
value="end_of_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration"
value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration"
value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if"
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation"
value="2"/>
+<setting
id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer"
value="2"/>
+<setting
id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header"
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional"
value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit"
value="120"/>
+<setting
id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
value="0"/>
+<setting
id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char"
value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size"
value="3"/>
+</profile>
+</profiles>
Copied: stack/native/trunk/eclipse/jboss-style.xml (from rev 10915,
stack/native/branches/ropalka/eclipse/jboss-style.xml)
===================================================================
--- stack/native/trunk/eclipse/jboss-style.xml (rev 0)
+++ stack/native/trunk/eclipse/jboss-style.xml 2009-10-15 23:06:37 UTC (rev 10922)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+ Checkstyle-Configuration: jboss-checkstyle
+ Description: none
+-->
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+ <property name="severity" value="warning"/>
+ <module name="TreeWalker">
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+ <module name="AnonInnerLength"/>
+ <module name="ExecutableStatementCount">
+ <property name="max" value="60"/>
+ <property name="tokens"
value="INSTANCE_INIT,STATIC_INIT,METHOD_DEF,CTOR_DEF"/>
+ </module>
+ <module name="LineLength">
+ <property name="max" value="168"/>
+ <property name="tabWidth" value="3"/>
+ </module>
+ <module name="MethodLength"/>
+ <module name="ParameterNumber"/>
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/>
+ <module name="ImportOrder"/>
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+ <module name="AbstractClassName"/>
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName"/>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+ <module name="CovariantEquals"/>
+ <module name="DefaultComesLast"/>
+ <module name="DeclarationOrder"/>
+ <module name="DoubleCheckedLocking"/>
+ <module name="EqualsHashCode"/>
+ <module name="ExplicitInitialization"/>
+ <module name="FallThrough"/>
+ <module name="FinalLocalVariable"/>
+ <module name="IllegalInstantiation"/>
+ <module name="IllegalType">
+ <property name="tokens"
value="METHOD_DEF,PARAMETER_DEF"/>
+ </module>
+ <module name="InnerAssignment"/>
+ <module name="MagicNumber">
+ <property name="ignoreNumbers" value="-1, 0, 1"/>
+ </module>
+ <module name="MissingCtor"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="ModifiedControlVariable"/>
+ <module name="MultipleStringLiterals"/>
+ <module name="MultipleVariableDeclarations"/>
+ <module name="NestedIfDepth"/>
+ <module name="NestedTryDepth"/>
+ <module name="PackageDeclaration"/>
+ <module name="ParameterAssignment"/>
+ <module name="RedundantThrows">
+ <property name="logLoadErrors" value="true"/>
+ <property name="suppressLoadErrors" value="true"/>
+ </module>
+ <module name="RequireThis"/>
+ <module name="ReturnCount">
+ <property name="max" value="5"/>
+ </module>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+ <module name="StringLiteralEquality"/>
+ <module name="SuperClone"/>
+ <module name="SuperFinalize"/>
+ <module name="ArrayTrailingComma"/>
+ <module name="UnnecessaryParentheses"/>
+ <module name="DesignForExtension"/>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="ThrowsCount"/>
+ <module name="VisibilityModifier"/>
+ <module name="MutableException"/>
+ <module name="EmptyBlock"/>
+ <module name="LeftCurly">
+ <property name="option" value="nl"/>
+ <property name="maxLineLength" value="120"/>
+ </module>
+ <module name="RightCurly">
+ <property name="option" value="alone"/>
+ </module>
+ <module name="EmptyForInitializerPad">
+ <property name="option" value="space"/>
+ </module>
+ <module name="EmptyForIteratorPad">
+ <property name="option" value="space"/>
+ </module>
+ <module name="NoWhitespaceAfter"/>
+ <module name="NoWhitespaceBefore"/>
+ <module name="OperatorWrap">
+ <property name="option" value="eol"/>
+ <property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_INSTANCEOF,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,SL,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN"/>
+ </module>
+ <module name="MethodParamPad">
+ <property name="allowLineBreaks" value="true"/>
+ </module>
+ <module name="TabCharacter"/>
+ <module name="TypecastParenPad">
+ <property name="tokens" value="RPAREN,TYPECAST"/>
+ </module>
+ <module name="WhitespaceAround">
+ <property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
+ </module>
+ <module name="NeedBraces"/>
+ <module name="WhitespaceAfter">
+ <property name="tokens" value="COMMA,SEMI"/>
+ </module>
+ <module name="BooleanExpressionComplexity"/>
+ <module name="ClassDataAbstractionCoupling"/>
+ <module name="ClassFanOutComplexity"/>
+ <module name="CyclomaticComplexity"/>
+ <module name="JavaNCSS"/>
+ <module name="NPathComplexity"/>
+ <module name="UncommentedMain"/>
+ <module name="TodoComment"/>
+ <module name="TrailingComment"/>
+ <module name="Indentation">
+ <property name="basicOffset" value="3"/>
+ <property name="caseIndent" value="3"/>
+ </module>
+ <module name="FinalParameters"/>
+ <module name="ArrayTypeStyle"/>
+ <module name="JavadocMethod">
+ <property name="allowUndeclaredRTE" value="true"/>
+ <property name="logLoadErrors" value="true"/>
+ </module>
+ <module name="JavadocStyle"/>
+ <module name="JavadocType"/>
+ <module name="JavadocVariable"/>
+ <module name="WriteTag"/>
+ <module name="SuperFinalize"/>
+ </module>
+ <module name="NewlineAtEndOfFile"/>
+</module>
Copied: stack/native/trunk/modules/client/src/main/resources/META-INF/services (from rev
10915, stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services)
Deleted:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
===================================================================
---
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1 +0,0 @@
-org.jboss.wsf.framework.deployment.ArchiveDeploymentModelFactory
\ No newline at end of file
Copied:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
(from rev 10915,
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory)
===================================================================
---
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
(rev 0)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1 @@
+org.jboss.wsf.framework.deployment.ArchiveDeploymentModelFactory
\ No newline at end of file
Deleted:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
===================================================================
---
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyHttpServerFactory
\ No newline at end of file
Copied:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
(from rev 10915,
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory)
===================================================================
---
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
(rev 0)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1 @@
+org.jboss.ws.core.jaxws.spi.http.NettyHttpServerFactory
\ No newline at end of file
Deleted:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
===================================================================
---
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyInvocationHandlerFactory
\ No newline at end of file
Copied:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
(from rev 10915,
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory)
===================================================================
---
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
(rev 0)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1 @@
+org.jboss.ws.core.jaxws.spi.http.NettyInvocationHandlerFactory
\ No newline at end of file
Deleted:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
===================================================================
---
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyEndpointRegistryFactory
\ No newline at end of file
Copied:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
(from rev 10915,
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory)
===================================================================
---
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
(rev 0)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1 @@
+org.jboss.ws.core.jaxws.spi.http.NettyEndpointRegistryFactory
\ No newline at end of file
Deleted:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
===================================================================
---
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyHttpServerConfigFactory
\ No newline at end of file
Copied:
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
(from rev 10915,
stack/native/branches/ropalka/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory)
===================================================================
---
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
(rev 0)
+++
stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1 @@
+org.jboss.ws.core.jaxws.spi.http.NettyHttpServerConfigFactory
\ No newline at end of file
Modified: stack/native/trunk/modules/core/pom.xml
===================================================================
--- stack/native/trunk/modules/core/pom.xml 2009-10-15 23:02:53 UTC (rev 10921)
+++ stack/native/trunk/modules/core/pom.xml 2009-10-15 23:06:37 UTC (rev 10922)
@@ -27,6 +27,10 @@
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-framework</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
<artifactId>jbossws-spi</artifactId>
</dependency>
<dependency>
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -28,6 +28,7 @@
import java.net.URL;
import java.nio.channels.ClosedChannelException;
import java.util.Map;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@@ -113,6 +114,26 @@
*/
public Object invoke(Object reqMessage, String targetAddress, boolean oneway,
Map<String, Object> additionalHeaders, Map<String, Object> callProps) throws
IOException
{
+ try
+ {
+ return invokeInternal(reqMessage, targetAddress, oneway, additionalHeaders,
callProps);
+ }
+ catch (ClosedChannelException cce)
+ {
+ if (NettyTransportHandler.getHttpKeepAliveSet())
+ {
+ log.info("Retrying with a new connection..."); //because using keep-alive
connections it's possible to try re-using closed connections before they've been
evicted
+ return invokeInternal(reqMessage, targetAddress, oneway, additionalHeaders,
callProps);
+ }
+ else
+ {
+ throw cce;
+ }
+ }
+ }
+
+ private Object invokeInternal(Object reqMessage, String targetAddress, boolean oneway,
Map<String, Object> additionalHeaders, Map<String, Object> callProps) throws
IOException
+ {
URL target;
try
{
@@ -153,7 +174,17 @@
//Get the response
Future<Result> futureResult = responseHandler.getFutureResult();
- Result result = timeout == null ? futureResult.get() : futureResult.get(timeout,
TimeUnit.MILLISECONDS);
+ Result result = null;
+ try
+ {
+ result = timeout == null ? futureResult.get() : futureResult.get(timeout,
TimeUnit.MILLISECONDS);
+ }
+ catch (ExecutionException ee)
+ {
+ //unwrap ExecutionException
+ Throwable t = ee.getCause();
+ throw t != null ? t : ee;
+ }
resHeaders = result.getResponseHeaders();
Object resMessage = oneway ? null : unmarshaller.read(result.getResponse(),
resHeaders);
@@ -205,7 +236,7 @@
transport.finished(resHeaders);
}
}
-
+
private static SslHandler getSSLHandler(URL target, Map<String, Object>
callProps) throws IOException
{
SslHandler handler = null;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -312,7 +312,7 @@
}
}
- public boolean getHttpKeepAliveSet()
+ public static boolean getHttpKeepAliveSet()
{
return keepAliveProp;
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -45,6 +45,7 @@
import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.http.HttpContext;
import org.jboss.wsf.spi.http.HttpServer;
import org.jboss.wsf.spi.http.HttpServerFactory;
@@ -55,15 +56,13 @@
/**
* A Web service endpoint implementation.
*
- * @author Thomas.Diesler(a)jboss.com
- * @since 07-Jul-2006
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class EndpointImpl extends Endpoint
{
- // provide logging
- private final Logger log = Logger.getLogger(EndpointImpl.class);
- // The permission to publish an endpoint
+ private static final Logger log = Logger.getLogger(EndpointImpl.class);
private static final WebServicePermission ENDPOINT_PUBLISH_PERMISSION = new
WebServicePermission("publishEndpoint");
private Object implementor;
@@ -76,11 +75,14 @@
private boolean isPublished;
private boolean isDestroyed;
private URI address;
+ private Deployment dep;
public EndpointImpl(String bindingId, Object implementor, WebServiceFeature[]
features)
{
if (implementor == null)
+ {
throw new IllegalArgumentException("Implementor cannot be null");
+ }
this.implementor = implementor;
this.bindingProvider = new BindingProviderImpl(bindingId);
@@ -90,13 +92,13 @@
@Override
public Binding getBinding()
{
- return bindingProvider.getBinding();
+ return this.bindingProvider.getBinding();
}
@Override
public Object getImplementor()
{
- return implementor;
+ return this.implementor;
}
/**
@@ -107,7 +109,7 @@
* @param address specifying the address to use. The address must be compatible with
the binding specified at the time the endpoint was created.
*/
@Override
- public void publish(String addr)
+ public void publish(final String addr)
{
log.debug("publish: " + addr);
@@ -121,19 +123,16 @@
}
// Check with the security manger
- checkPublishEndpointPermission();
+ this.checkPublishEndpointPermission();
- // Create and start the HTTP server
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- HttpServer httpServer =
spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
- httpServer.setProperties(properties);
- httpServer.start();
+ // Get HTTP server
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final HttpServer httpServer =
spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
- String path = address.getPath();
- String contextRoot = "/" + new StringTokenizer(path,
"/").nextToken();
- HttpContext context = httpServer.createContext(contextRoot);
+ final String contextRoot = this.getContextRoot();
+ final HttpContext context = httpServer.createContext(contextRoot);
- publish(context);
+ this.publish(context);
}
/**
@@ -146,7 +145,10 @@
@Override
public void publish(Object context)
{
- log.debug("publish: " + context);
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+
+ log.debug("publishing endpoint " + this + " to " + context);
if (isDestroyed)
throw new IllegalStateException("Endpoint already destroyed");
@@ -154,32 +156,21 @@
// Check with the security manger
checkPublishEndpointPermission();
- /* Check if we are standalone
- boolean isStandalone;
- try
+ if (context instanceof HttpContext)
{
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
- isStandalone = false;
+ this.serverContext = (HttpContext)context;
+ if (this.address == null)
+ {
+ this.address = getAddressFromConfigAndContext(serverContext); // TODO: is it
necessary?
+ }
+ HttpServer httpServer = this.serverContext.getHttpServer();
+ httpServer.publish(this.serverContext, this);
+ this.isPublished = true;
}
- catch (Exception ex)
+ else
{
- // ignore, there should be no ServerConfigFactory in VM
- isStandalone = true;
+ throw new UnsupportedOperationException("Cannot handle contexts of type:
" + context);
}
-
- if (isStandalone == false)
- throw new IllegalStateException("Cannot publish endpoint from within
server");
- */
-
- if (context instanceof HttpContext)
- {
- serverContext = (HttpContext)context;
- address = getAddressFromConfigAndContext(serverContext);
- HttpServer httpServer = serverContext.getHttpServer();
- httpServer.publish(serverContext, this);
- isPublished = true;
- }
}
private static URI getAddressFromConfigAndContext(HttpContext context)
@@ -228,45 +219,45 @@
@Override
public boolean isPublished()
{
- return isPublished;
+ return this.isPublished;
}
@Override
public List<Source> getMetadata()
{
- return metadata;
+ return this.metadata;
}
@Override
- public void setMetadata(List<Source> list)
+ public void setMetadata(final List<Source> list)
{
- log.info("Ignore metadata, not implemented");
+ log.info("Ignore metadata, not implemented"); // TODO:
this.metadata = list;
}
@Override
public Executor getExecutor()
{
- return executor;
+ return this.executor;
}
@Override
public void setExecutor(Executor executor)
{
- log.info("Ignore executor, not implemented");
+ log.info("Ignore executor, not implemented"); // TODO
this.executor = executor;
}
@Override
public Map<String, Object> getProperties()
{
- return properties;
+ return this.properties;
}
@Override
public void setProperties(Map<String, Object> map)
{
- properties = map;
+ this.properties = map;
}
private void checkPublishEndpointPermission()
@@ -295,7 +286,8 @@
{
if (isDestroyed || !isPublished)
throw new WebServiceException("Cannot get EPR for an unpubblished or
already destroyed endpoint!");
- if (getBinding() instanceof HTTPBinding )
+
+ if (getBinding() instanceof HTTPBinding)
{
throw new UnsupportedOperationException("Cannot get epr when using the
XML/HTTP binding");
}
@@ -308,6 +300,69 @@
for (Element el : referenceParameters)
builder.referenceParameter(el);
}
+
return EndpointReferenceUtil.transform(clazz, builder.build());
}
+
+ public String getPath()
+ {
+ String path = this.address.getPath();
+ while (path.endsWith("/"))
+ {
+ path = path.substring(0, path.length() - 1);
+ }
+ return path;
+ }
+
+ public int getPort()
+ {
+ return this.address.getPort();
+ }
+
+ public String getContextRoot()
+ {
+ final StringTokenizer st = new StringTokenizer(this.getPath(), "/");
+
+ String contextRoot = "/";
+
+ if (st.hasMoreTokens())
+ {
+ contextRoot += st.nextToken();
+ }
+
+ return contextRoot;
+ }
+
+ public String getPathWithoutContext()
+ {
+ // TODO: optimize this method
+ StringTokenizer st = new StringTokenizer(this.getPath(), "/");
+ if (st.hasMoreTokens())
+ {
+ st.nextToken();
+ }
+ StringBuilder sb = new StringBuilder();
+ while (st.hasMoreTokens())
+ {
+ sb.append('/');
+ sb.append(st.nextToken());
+ }
+ sb.append('/');
+
+ return sb.toString();
+ }
+
+ public void setDeployment(final Deployment dep)
+ {
+ if (this.dep == null)
+ {
+ this.dep = dep;
+ }
+ }
+
+ public Deployment getDeployment()
+ {
+ return this.dep;
+ }
+
}
Copied: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http)
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,248 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.handler.codec.http.Cookie;
-import org.jboss.netty.handler.codec.http.CookieDecoder;
-import org.jboss.netty.handler.codec.http.CookieEncoder;
-import org.jboss.netty.handler.codec.http.DefaultHttpMessage;
-import org.jboss.netty.handler.codec.http.HttpHeaders;
-import org.jboss.netty.handler.codec.http.HttpRequest;
-import org.jboss.netty.handler.codec.http.HttpResponse;
-import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import org.jboss.netty.handler.codec.http.HttpVersion;
-import org.jboss.ws.core.server.MimeHeaderSource;
-
-/**
- * HTTP 1.1 response implementation.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public abstract class AbstractNettyMessage extends DefaultHttpMessage implements
MimeHeaderSource, HttpResponse
-{
-
- /** HTTP response status code. */
- private HttpResponseStatus status;
-
- /** HTTP request this reponse relates to. */
- private HttpRequest request;
-
- /** HTTP channel. */
- private Channel channel;
-
- /**
- * Constructor.
- *
- * @param version HTTP protocol version
- * @param channel Netty channel
- * @param request original request
- */
- protected AbstractNettyMessage(final HttpVersion version, final Channel channel, final
HttpRequest request)
- {
- super(version);
-
- this.channel = channel;
- this.request = request;
- }
-
- /**
- * Gets request input stream.
- *
- * @return request input stream
- */
- public abstract InputStream getInputStream();
-
- /**
- * Gets response output stream.
- *
- * @return response output stream.
- */
- public abstract OutputStream getOutputStream();
-
- /**
- * Returns HTTP request.
- *
- * @return HTTP request
- */
- protected final HttpRequest getRequest()
- {
- return this.request;
- }
-
- /**
- * Returns Netty channel.
- *
- * @return Netty channel
- */
- protected final Channel getChannel()
- {
- return this.channel;
- }
-
- /**
- * Returns response status code.
- *
- * @return message status code
- */
- public final HttpResponseStatus getStatus()
- {
- return this.status;
- }
-
- /**
- * Sets response status code.
- * @param sc response status code
- */
- public final void setStatus(final int sc)
- {
- this.status = HttpResponseStatus.valueOf(sc);
- }
-
- /**
- * Sets cookis to response.
- */
- public final void setCookies()
- {
- final String cookieString = this.getRequest().getHeader(HttpHeaders.Names.COOKIE);
- if (cookieString != null)
- {
- final CookieDecoder cookieDecoder = new CookieDecoder();
- final Set<Cookie> cookies = cookieDecoder.decode(cookieString);
- if (!cookies.isEmpty())
- {
- // Reset the cookies if necessary.
- final CookieEncoder cookieEncoder = new CookieEncoder(true);
- for (Cookie cookie : cookies)
- {
- cookieEncoder.addCookie(cookie);
- }
- this.addHeader(HttpHeaders.Names.SET_COOKIE, cookieEncoder.encode());
- }
- }
- }
-
- /**
- * String representation of the instance.
- *
- * @return string
- */
- @Override
- public final String toString()
- {
- return this.getProtocolVersion().getText() + ' ' + this.getStatus();
- }
-
- /**
- * @see MimeHeaderSource#getMimeHeaders()
- *
- * @return mime headers
- */
- public final MimeHeaders getMimeHeaders()
- {
- if (this.request.getHeaderNames().size() == 0)
- {
- return null;
- }
-
- final MimeHeaders headers = new MimeHeaders();
-
- final Iterator<String> e = this.request.getHeaderNames().iterator();
- String key = null;
- String value = null;
- while (e.hasNext())
- {
- key = e.next();
- value = this.request.getHeader(key);
-
- headers.addHeader(key, value);
- }
-
- return headers;
- }
-
- /**
- * @see MimeHeaderSource#setMimeHeaders(MimeHeaders)
- *
- * @param headers mime headers
- */
- public final void setMimeHeaders(final MimeHeaders headers)
- {
- final Iterator<?> i = headers.getAllHeaders();
- String key = null;
- while (i.hasNext())
- {
- final MimeHeader header = (MimeHeader) i.next();
- key = header.getName();
- List<String> values = new LinkedList<String>();
- values.add(header.getValue());
- values = this.removeProhibitedCharacters(values);
- this.setHeader(key, values);
- }
- }
-
- // TODO:
https://jira.jboss.org/jira/browse/NETTY-237
- /**
- * Removes prohibited header value characters.
- *
- * @param values header values before optimization
- * @return optimized header values
- */
- private List<String> removeProhibitedCharacters(final List<String>
values)
- {
- final List<String> retVal = new LinkedList<String>();
- for (int i = 0; i < values.size(); i++)
- {
- retVal.add(i, this.removeProhibitedCharacters(values.get(i)));
- }
-
- return retVal;
- }
-
- // TODO:
https://jira.jboss.org/jira/browse/NETTY-237
- /**
- * Removes prohibited header value characters.
- *
- * @param value header value before optimization
- * @return optimized header value
- */
- private String removeProhibitedCharacters(final String value)
- {
- String retVal = value;
-
- retVal = retVal.replace('\r', ' ');
- retVal = retVal.replace('\n', ' ');
-
- return retVal;
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/AbstractNettyMessage.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,248 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.handler.codec.http.Cookie;
+import org.jboss.netty.handler.codec.http.CookieDecoder;
+import org.jboss.netty.handler.codec.http.CookieEncoder;
+import org.jboss.netty.handler.codec.http.DefaultHttpMessage;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
+import org.jboss.netty.handler.codec.http.HttpRequest;
+import org.jboss.netty.handler.codec.http.HttpResponse;
+import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import org.jboss.netty.handler.codec.http.HttpVersion;
+import org.jboss.ws.core.server.MimeHeaderSource;
+
+/**
+ * HTTP 1.1 response implementation.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public abstract class AbstractNettyMessage extends DefaultHttpMessage implements
MimeHeaderSource, HttpResponse
+{
+
+ /** HTTP response status code. */
+ private HttpResponseStatus status;
+
+ /** HTTP request this reponse relates to. */
+ private HttpRequest request;
+
+ /** HTTP channel. */
+ private Channel channel;
+
+ /**
+ * Constructor.
+ *
+ * @param version HTTP protocol version
+ * @param channel Netty channel
+ * @param request original request
+ */
+ protected AbstractNettyMessage(final HttpVersion version, final Channel channel, final
HttpRequest request)
+ {
+ super(version);
+
+ this.channel = channel;
+ this.request = request;
+ }
+
+ /**
+ * Gets request input stream.
+ *
+ * @return request input stream
+ */
+ public abstract InputStream getInputStream();
+
+ /**
+ * Gets response output stream.
+ *
+ * @return response output stream.
+ */
+ public abstract OutputStream getOutputStream();
+
+ /**
+ * Returns HTTP request.
+ *
+ * @return HTTP request
+ */
+ protected final HttpRequest getRequest()
+ {
+ return this.request;
+ }
+
+ /**
+ * Returns Netty channel.
+ *
+ * @return Netty channel
+ */
+ protected final Channel getChannel()
+ {
+ return this.channel;
+ }
+
+ /**
+ * Returns response status code.
+ *
+ * @return message status code
+ */
+ public final HttpResponseStatus getStatus()
+ {
+ return this.status;
+ }
+
+ /**
+ * Sets response status code.
+ * @param sc response status code
+ */
+ public final void setStatus(final int sc)
+ {
+ this.status = HttpResponseStatus.valueOf(sc);
+ }
+
+ /**
+ * Sets cookis to response.
+ */
+ public final void setCookies()
+ {
+ final String cookieString = this.getRequest().getHeader(HttpHeaders.Names.COOKIE);
+ if (cookieString != null)
+ {
+ final CookieDecoder cookieDecoder = new CookieDecoder();
+ final Set<Cookie> cookies = cookieDecoder.decode(cookieString);
+ if (!cookies.isEmpty())
+ {
+ // Reset the cookies if necessary.
+ final CookieEncoder cookieEncoder = new CookieEncoder(true);
+ for (Cookie cookie : cookies)
+ {
+ cookieEncoder.addCookie(cookie);
+ }
+ this.addHeader(HttpHeaders.Names.SET_COOKIE, cookieEncoder.encode());
+ }
+ }
+ }
+
+ /**
+ * String representation of the instance.
+ *
+ * @return string
+ */
+ @Override
+ public final String toString()
+ {
+ return this.getProtocolVersion().getText() + ' ' + this.getStatus();
+ }
+
+ /**
+ * @see MimeHeaderSource#getMimeHeaders()
+ *
+ * @return mime headers
+ */
+ public final MimeHeaders getMimeHeaders()
+ {
+ if (this.request.getHeaderNames().size() == 0)
+ {
+ return null;
+ }
+
+ final MimeHeaders headers = new MimeHeaders();
+
+ final Iterator<String> e = this.request.getHeaderNames().iterator();
+ String key = null;
+ String value = null;
+ while (e.hasNext())
+ {
+ key = e.next();
+ value = this.request.getHeader(key);
+
+ headers.addHeader(key, value);
+ }
+
+ return headers;
+ }
+
+ /**
+ * @see MimeHeaderSource#setMimeHeaders(MimeHeaders)
+ *
+ * @param headers mime headers
+ */
+ public final void setMimeHeaders(final MimeHeaders headers)
+ {
+ final Iterator<?> i = headers.getAllHeaders();
+ String key = null;
+ while (i.hasNext())
+ {
+ final MimeHeader header = (MimeHeader) i.next();
+ key = header.getName();
+ List<String> values = new LinkedList<String>();
+ values.add(header.getValue());
+ values = this.removeProhibitedCharacters(values);
+ this.setHeader(key, values);
+ }
+ }
+
+ // TODO:
https://jira.jboss.org/jira/browse/NETTY-237
+ /**
+ * Removes prohibited header value characters.
+ *
+ * @param values header values before optimization
+ * @return optimized header values
+ */
+ private List<String> removeProhibitedCharacters(final List<String>
values)
+ {
+ final List<String> retVal = new LinkedList<String>();
+ for (int i = 0; i < values.size(); i++)
+ {
+ retVal.add(i, this.removeProhibitedCharacters(values.get(i)));
+ }
+
+ return retVal;
+ }
+
+ // TODO:
https://jira.jboss.org/jira/browse/NETTY-237
+ /**
+ * Removes prohibited header value characters.
+ *
+ * @param value header value before optimization
+ * @return optimized header value
+ */
+ private String removeProhibitedCharacters(final String value)
+ {
+ String retVal = value;
+
+ retVal = retVal.replace('\r', ' ');
+ retVal = retVal.replace('\n', ' ');
+
+ return retVal;
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,226 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.netty.NettyCallbackHandler;
-import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandlerImpl;
-import org.jboss.wsf.common.injection.InjectionHelper;
-import org.jboss.wsf.common.injection.PreDestroyHolder;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-import org.jboss.wsf.spi.management.EndpointResolver;
-import org.jboss.wsf.stack.jbws.WebAppResolver;
-
-/**
- * Netty callback handler operating in JSE environment (replacement for Servlet on J2EE
side).
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class NettyCallbackHandlerImpl implements NettyCallbackHandler
-{
-
- /** Logger. */
- private static final Logger LOGGER = Logger.getLogger(RMCallbackHandlerImpl.class);
-
- /** SPI provider instance. */
- private static final SPIProvider SPI_PROVIDER =
SPIProviderResolver.getInstance().getProvider();
-
- /** Endpoints registry. */
- private static final EndpointRegistry ENDPOINTS_REGISTRY =
NettyCallbackHandlerImpl.SPI_PROVIDER.getSPI(
- EndpointRegistryFactory.class).getEndpointRegistry();
-
- /** @PreDestroy registry. */
- private final List<PreDestroyHolder> preDestroyRegistry = new
LinkedList<PreDestroyHolder>();
-
- /** Path this Netty callback operates on. */
- private final String handledPath;
-
- /** Endpoint associated with this callback. */
- private Endpoint endpoint;
-
- /**
- * Constructor.
- *
- * @param path this handler operates on
- * @param context this handler operates on
- * @param endpointRegistryPath registry id
- */
- public NettyCallbackHandlerImpl(final String path, final String context, final String
endpointRegistryPath)
- {
- super();
- this.initEndpoint(context, endpointRegistryPath);
- this.handledPath = path;
- }
-
- /**
- * Initialize the service endpoint and associate it with this callback.
- *
- * @param context context path
- * @param endpointRegistryPath registry id
- */
- private void initEndpoint(final String context, final String endpointRegistryPath)
- {
- final EndpointResolver resolver = new WebAppResolver(context,
endpointRegistryPath);
- this.endpoint = NettyCallbackHandlerImpl.ENDPOINTS_REGISTRY.resolve(resolver);
-
- if (this.endpoint == null)
- {
- throw new WebServiceException("Cannot obtain endpoint for: " +
endpointRegistryPath);
- }
- }
-
- /**
- * Handles either WSDL GET request or endpoint POST invocation.
- *
- * @param method only HTTP GET and POST methods are supported
- * @param is input stream
- * @param os output stream
- * @param invCtx invocation context
- * @throws IOException if some I/O error occurs
- */
- public void handle(final String method, final InputStream is, final OutputStream os,
final InvocationContext invCtx)
- throws IOException
- {
- try
- {
- EndpointAssociation.setEndpoint(this.endpoint);
- final RequestHandler requestHandler = this.endpoint.getRequestHandler();
-
- if (method.equals("POST"))
- {
- requestHandler.handleRequest(this.endpoint, is, os, invCtx);
- }
- else if (method.equals("GET"))
- {
- requestHandler.handleWSDLRequest(this.endpoint, os, invCtx);
- }
- else
- {
- throw new WSException("Unsupported HTTP method: " + method);
- }
- }
- catch (final Exception e)
- {
- NettyCallbackHandlerImpl.LOGGER.error(e.getMessage(), e);
- }
- finally
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- NettyCallbackHandlerImpl.LOGGER.error(e.getMessage(), e);
- }
- try
- {
- os.close();
- }
- catch (IOException e)
- {
- NettyCallbackHandlerImpl.LOGGER.error(e.getMessage(), e);
- }
- this.registerForPreDestroy(this.endpoint);
- EndpointAssociation.removeEndpoint();
- }
- }
-
- /**
- * Returns request path this callback operates on.
- *
- * @return callback path
- */
- public String getPath()
- {
- return this.handledPath;
- }
-
- /**
- * Registers endpoint for with @PreDestroy registry.
- *
- * @param endpoint webservice endpoint
- */
- private void registerForPreDestroy(final Endpoint endpoint)
- {
- final PreDestroyHolder holder = (PreDestroyHolder)
endpoint.getAttachment(PreDestroyHolder.class);
- if (holder != null)
- {
- synchronized (this.preDestroyRegistry)
- {
- if (!this.preDestroyRegistry.contains(holder))
- {
- this.preDestroyRegistry.add(holder);
- }
- }
- endpoint.removeAttachment(PreDestroyHolder.class);
- }
- }
-
- /**
- * Template lifecycle method that does nothing in this implementation.
- */
- public void init()
- {
- // Does nothing
- }
-
- /**
- * Calls @PreDestroy annotated methods on endpoint bean.
- */
- public void destroy()
- {
- synchronized (this.preDestroyRegistry)
- {
- for (final PreDestroyHolder holder : this.preDestroyRegistry)
- {
- try
- {
- final Object targetBean = holder.getObject();
- InjectionHelper.callPreDestroyMethod(targetBean);
- }
- catch (Exception exception)
- {
- NettyCallbackHandlerImpl.LOGGER.error(exception.getMessage(), exception);
- }
- }
- this.preDestroyRegistry.clear();
- }
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,226 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.netty.NettyCallbackHandler;
+import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandlerImpl;
+import org.jboss.wsf.common.injection.InjectionHelper;
+import org.jboss.wsf.common.injection.PreDestroyHolder;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.wsf.spi.management.EndpointResolver;
+import org.jboss.wsf.stack.jbws.WebAppResolver;
+
+/**
+ * Netty callback handler operating in JSE environment (replacement for Servlet on J2EE
side).
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class NettyCallbackHandlerImpl implements NettyCallbackHandler
+{
+
+ /** Logger. */
+ private static final Logger LOGGER = Logger.getLogger(RMCallbackHandlerImpl.class);
+
+ /** SPI provider instance. */
+ private static final SPIProvider SPI_PROVIDER =
SPIProviderResolver.getInstance().getProvider();
+
+ /** Endpoints registry. */
+ private static final EndpointRegistry ENDPOINTS_REGISTRY =
NettyCallbackHandlerImpl.SPI_PROVIDER.getSPI(
+ EndpointRegistryFactory.class).getEndpointRegistry();
+
+ /** @PreDestroy registry. */
+ private final List<PreDestroyHolder> preDestroyRegistry = new
LinkedList<PreDestroyHolder>();
+
+ /** Path this Netty callback operates on. */
+ private final String handledPath;
+
+ /** Endpoint associated with this callback. */
+ private Endpoint endpoint;
+
+ /**
+ * Constructor.
+ *
+ * @param path this handler operates on
+ * @param context this handler operates on
+ * @param endpointRegistryPath registry id
+ */
+ public NettyCallbackHandlerImpl(final String path, final String context, final String
endpointRegistryPath)
+ {
+ super();
+ this.initEndpoint(context, endpointRegistryPath);
+ this.handledPath = path;
+ }
+
+ /**
+ * Initialize the service endpoint and associate it with this callback.
+ *
+ * @param context context path
+ * @param endpointRegistryPath registry id
+ */
+ private void initEndpoint(final String context, final String endpointRegistryPath)
+ {
+ final EndpointResolver resolver = new WebAppResolver(context,
endpointRegistryPath);
+ this.endpoint = NettyCallbackHandlerImpl.ENDPOINTS_REGISTRY.resolve(resolver);
+
+ if (this.endpoint == null)
+ {
+ throw new WebServiceException("Cannot obtain endpoint for: " +
endpointRegistryPath);
+ }
+ }
+
+ /**
+ * Handles either WSDL GET request or endpoint POST invocation.
+ *
+ * @param method only HTTP GET and POST methods are supported
+ * @param is input stream
+ * @param os output stream
+ * @param invCtx invocation context
+ * @throws IOException if some I/O error occurs
+ */
+ public void handle(final String method, final InputStream is, final OutputStream os,
final InvocationContext invCtx)
+ throws IOException
+ {
+ try
+ {
+ EndpointAssociation.setEndpoint(this.endpoint);
+ final RequestHandler requestHandler = this.endpoint.getRequestHandler();
+
+ if (method.equals("POST"))
+ {
+ requestHandler.handleRequest(this.endpoint, is, os, invCtx);
+ }
+ else if (method.equals("GET"))
+ {
+ requestHandler.handleWSDLRequest(this.endpoint, os, invCtx);
+ }
+ else
+ {
+ throw new WSException("Unsupported HTTP method: " + method);
+ }
+ }
+ catch (final Exception e)
+ {
+ NettyCallbackHandlerImpl.LOGGER.error(e.getMessage(), e);
+ }
+ finally
+ {
+ try
+ {
+ is.close();
+ }
+ catch (IOException e)
+ {
+ NettyCallbackHandlerImpl.LOGGER.error(e.getMessage(), e);
+ }
+ try
+ {
+ os.close();
+ }
+ catch (IOException e)
+ {
+ NettyCallbackHandlerImpl.LOGGER.error(e.getMessage(), e);
+ }
+ this.registerForPreDestroy(this.endpoint);
+ EndpointAssociation.removeEndpoint();
+ }
+ }
+
+ /**
+ * Returns request path this callback operates on.
+ *
+ * @return callback path
+ */
+ public String getPath()
+ {
+ return this.handledPath;
+ }
+
+ /**
+ * Registers endpoint for with @PreDestroy registry.
+ *
+ * @param endpoint webservice endpoint
+ */
+ private void registerForPreDestroy(final Endpoint endpoint)
+ {
+ final PreDestroyHolder holder = (PreDestroyHolder)
endpoint.getAttachment(PreDestroyHolder.class);
+ if (holder != null)
+ {
+ synchronized (this.preDestroyRegistry)
+ {
+ if (!this.preDestroyRegistry.contains(holder))
+ {
+ this.preDestroyRegistry.add(holder);
+ }
+ }
+ endpoint.removeAttachment(PreDestroyHolder.class);
+ }
+ }
+
+ /**
+ * Template lifecycle method that does nothing in this implementation.
+ */
+ public void init()
+ {
+ // Does nothing
+ }
+
+ /**
+ * Calls @PreDestroy annotated methods on endpoint bean.
+ */
+ public void destroy()
+ {
+ synchronized (this.preDestroyRegistry)
+ {
+ for (final PreDestroyHolder holder : this.preDestroyRegistry)
+ {
+ try
+ {
+ final Object targetBean = holder.getObject();
+ InjectionHelper.callPreDestroyMethod(targetBean);
+ }
+ catch (Exception exception)
+ {
+ NettyCallbackHandlerImpl.LOGGER.error(exception.getMessage(), exception);
+ }
+ }
+ this.preDestroyRegistry.clear();
+ }
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import org.jboss.wsf.framework.management.DefaultEndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-
-/**
- * Netty server endpoint registry factory for JSE environment.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class NettyEndpointRegistryFactory extends EndpointRegistryFactory
-{
-
- /** Endpoing registry singleton. */
- private static final EndpointRegistry ENDPOINT_REGISTRY = new
DefaultEndpointRegistry();
-
- /**
- * Constructor.
- */
- public NettyEndpointRegistryFactory()
- {
- super();
- }
-
- /**
- * Returns endpoint registry.
- *
- * @return endpoint registry
- */
- @Override
- public EndpointRegistry getEndpointRegistry()
- {
- return NettyEndpointRegistryFactory.ENDPOINT_REGISTRY;
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import org.jboss.wsf.framework.management.DefaultEndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+
+/**
+ * Netty server endpoint registry factory for JSE environment.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class NettyEndpointRegistryFactory extends EndpointRegistryFactory
+{
+
+ /** Endpoing registry singleton. */
+ private static final EndpointRegistry ENDPOINT_REGISTRY = new
DefaultEndpointRegistry();
+
+ /**
+ * Constructor.
+ */
+ public NettyEndpointRegistryFactory()
+ {
+ super();
+ }
+
+ /**
+ * Returns endpoint registry.
+ *
+ * @return endpoint registry
+ */
+ @Override
+ public EndpointRegistry getEndpointRegistry()
+ {
+ return NettyEndpointRegistryFactory.ENDPOINT_REGISTRY;
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,200 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.jboss.netty.buffer.ChannelBufferInputStream;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.handler.codec.http.HttpHeaders;
-import org.jboss.netty.handler.codec.http.HttpRequest;
-import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import org.jboss.netty.handler.codec.http.HttpVersion;
-import org.jboss.ws.core.client.transport.NettyTransportOutputStream;
-
-/**
- * HTTP 1.1 message.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class NettyHttp11Message extends AbstractNettyMessage
-{
-
- /** Chunks size. */
- private static final int CHUNK_SIZE = 1024;
- /** Flag indicating HTTP headers have been written to the stream. */
- private boolean headersWritten;
-
- /**
- * Constructor.
- *
- * @param channel Netty channel
- * @param request original request
- */
- public NettyHttp11Message(final Channel channel, final HttpRequest request)
- {
- super(HttpVersion.HTTP_1_1, channel, request);
- }
-
- /**
- * @see AbstractNettyMessage#getInputStream()
- *
- * @return request input stream
- */
- public InputStream getInputStream()
- {
- return new ChannelBufferInputStream(this.getRequest().getContent());
- }
-
- /**
- * @see AbstractNettyMessage#getOutputStream()
- *
- * @return response output stream
- */
- public OutputStream getOutputStream()
- {
- return new ChunkingOutputStream(this, new
NettyTransportOutputStream(this.getChannel(), NettyHttp11Message.CHUNK_SIZE));
- }
-
- /**
- * Ensures HTTP message headers are written before message body.
- */
- private void flushHeaders()
- {
- if (this.headersWritten)
- {
- return;
- }
-
- this.headersWritten = true;
-
- if (this.getStatus() == null)
- {
- this.setStatus(HttpResponseStatus.OK.getCode());
- }
- if (this.getHeader(HttpHeaders.Names.CONTENT_TYPE) == null)
- {
- this.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/xml;
charset=UTF-8");
- }
- this.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, "chunked");
- this.setCookies();
-
- // Write the response headers
- this.getChannel().write(this);
- }
-
- /**
- * Chunking output stream.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard
Opalka</a>
- */
- private static final class ChunkingOutputStream extends OutputStream
- {
-
- /** Netty output stream. */
- private final NettyTransportOutputStream delegee;
- /** Netty message. */
- private final NettyHttp11Message message;
-
- /**
- * Constructor.
- *
- * @param message wrapped netty message
- * @param os wrapped output stream
- */
- public ChunkingOutputStream(final NettyHttp11Message message, final
NettyTransportOutputStream os)
- {
- super();
-
- this.message = message;
- this.delegee = os;
- }
-
- /**
- * @see OutputStream#write(int)
- *
- * @param b byte
- * @throws IOException if some I/O error occurs
- */
- @Override
- public void write(final int b) throws IOException
- {
- this.message.flushHeaders();
- this.delegee.write(b);
- }
-
- /**
- * @see OutputStream#write(byte[], int, int)
- *
- * @param b byte array
- * @param off offset
- * @param len length
- * @throws IOException if some I/O error occurs
- */
- @Override
- public void write(final byte[] b, final int off, final int len) throws IOException
- {
- this.message.flushHeaders();
- this.delegee.write(b, off, len);
- }
-
- /**
- * @see OutputStream#write(byte[])
- *
- * @param b byte array
- * @throws IOException if some I/O error occurs
- */
- @Override
- public void write(final byte[] b) throws IOException
- {
- this.message.flushHeaders();
- this.delegee.write(b);
- }
-
- /**
- * @see OutputStream#flush()
- *
- * @throws IOException if some I/O error occurs
- */
- @Override
- public void flush() throws IOException
- {
- this.delegee.flush();
- }
-
- /**
- * @see OutputStream#close()
- *
- * @throws IOException if some I/O error occurs
- */
- @Override
- public void close() throws IOException
- {
- this.delegee.close();
- this.delegee.getChannelFuture().awaitUninterruptibly();
- }
-
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttp11Message.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.jboss.netty.buffer.ChannelBufferInputStream;
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
+import org.jboss.netty.handler.codec.http.HttpRequest;
+import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import org.jboss.netty.handler.codec.http.HttpVersion;
+import org.jboss.ws.core.client.transport.NettyTransportOutputStream;
+
+/**
+ * HTTP 1.1 message.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class NettyHttp11Message extends AbstractNettyMessage
+{
+
+ /** Chunks size. */
+ private static final int CHUNK_SIZE = 1024;
+ /** Flag indicating HTTP headers have been written to the stream. */
+ private boolean headersWritten;
+
+ /**
+ * Constructor.
+ *
+ * @param channel Netty channel
+ * @param request original request
+ */
+ public NettyHttp11Message(final Channel channel, final HttpRequest request)
+ {
+ super(HttpVersion.HTTP_1_1, channel, request);
+ }
+
+ /**
+ * @see AbstractNettyMessage#getInputStream()
+ *
+ * @return request input stream
+ */
+ public InputStream getInputStream()
+ {
+ return new ChannelBufferInputStream(this.getRequest().getContent());
+ }
+
+ /**
+ * @see AbstractNettyMessage#getOutputStream()
+ *
+ * @return response output stream
+ */
+ public OutputStream getOutputStream()
+ {
+ return new ChunkingOutputStream(this, new
NettyTransportOutputStream(this.getChannel(), NettyHttp11Message.CHUNK_SIZE));
+ }
+
+ /**
+ * Ensures HTTP message headers are written before message body.
+ */
+ private void flushHeaders()
+ {
+ if (this.headersWritten)
+ {
+ return;
+ }
+
+ this.headersWritten = true;
+
+ if (this.getStatus() == null)
+ {
+ this.setStatus(HttpResponseStatus.OK.getCode());
+ }
+ if (this.getHeader(HttpHeaders.Names.CONTENT_TYPE) == null)
+ {
+ this.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/xml;
charset=UTF-8");
+ }
+ this.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, "chunked");
+ this.setCookies();
+
+ // Write the response headers
+ this.getChannel().write(this);
+ }
+
+ /**
+ * Chunking output stream.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard
Opalka</a>
+ */
+ private static final class ChunkingOutputStream extends OutputStream
+ {
+
+ /** Netty output stream. */
+ private final NettyTransportOutputStream delegee;
+ /** Netty message. */
+ private final NettyHttp11Message message;
+
+ /**
+ * Constructor.
+ *
+ * @param message wrapped netty message
+ * @param os wrapped output stream
+ */
+ public ChunkingOutputStream(final NettyHttp11Message message, final
NettyTransportOutputStream os)
+ {
+ super();
+
+ this.message = message;
+ this.delegee = os;
+ }
+
+ /**
+ * @see OutputStream#write(int)
+ *
+ * @param b byte
+ * @throws IOException if some I/O error occurs
+ */
+ @Override
+ public void write(final int b) throws IOException
+ {
+ this.message.flushHeaders();
+ this.delegee.write(b);
+ }
+
+ /**
+ * @see OutputStream#write(byte[], int, int)
+ *
+ * @param b byte array
+ * @param off offset
+ * @param len length
+ * @throws IOException if some I/O error occurs
+ */
+ @Override
+ public void write(final byte[] b, final int off, final int len) throws IOException
+ {
+ this.message.flushHeaders();
+ this.delegee.write(b, off, len);
+ }
+
+ /**
+ * @see OutputStream#write(byte[])
+ *
+ * @param b byte array
+ * @throws IOException if some I/O error occurs
+ */
+ @Override
+ public void write(final byte[] b) throws IOException
+ {
+ this.message.flushHeaders();
+ this.delegee.write(b);
+ }
+
+ /**
+ * @see OutputStream#flush()
+ *
+ * @throws IOException if some I/O error occurs
+ */
+ @Override
+ public void flush() throws IOException
+ {
+ this.delegee.flush();
+ }
+
+ /**
+ * @see OutputStream#close()
+ *
+ * @throws IOException if some I/O error occurs
+ */
+ @Override
+ public void close() throws IOException
+ {
+ this.delegee.close();
+ this.delegee.getChannelFuture().awaitUninterruptibly();
+ }
+
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,220 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.ws.Endpoint;
-
-import org.jboss.ws.core.jaxws.spi.EndpointImpl;
-import org.jboss.ws.core.server.netty.NettyCallbackHandler;
-import org.jboss.ws.core.server.netty.NettyHttpServer;
-import org.jboss.ws.core.server.netty.NettyHttpServerFactory;
-import org.jboss.ws.core.server.netty.NettyRequestHandlerFactory;
-import org.jboss.wsf.common.ResourceLoaderAdapter;
-import org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect;
-import org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl;
-import org.jboss.wsf.framework.deployment.EndpointAddressDeploymentAspect;
-import org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect;
-import org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect;
-import org.jboss.wsf.framework.deployment.EndpointNameDeploymentAspect;
-import org.jboss.wsf.framework.deployment.EndpointRegistryDeploymentAspect;
-import org.jboss.wsf.framework.deployment.URLPatternDeploymentAspect;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
-import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
-import org.jboss.wsf.spi.http.HttpContext;
-import org.jboss.wsf.spi.http.HttpContextFactory;
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect;
-import org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect;
-import org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeploymentAspect;
-import org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect;
-
-/**
- * Netty HTTP server adapter.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class NettyHttpServerAdapter implements HttpServer
-{
-
- /** JBossWS SPI provider. */
- private static final SPIProvider SPI_PROVIDER =
SPIProviderResolver.getInstance().getProvider();
-
- /** JBossWS Http Context factory. */
- private static final HttpContextFactory HTTP_CONTEXT_FACTORY =
NettyHttpServerAdapter.SPI_PROVIDER
- .getSPI(HttpContextFactory.class);
-
- /** Deployment model factory. */
- private static final DeploymentModelFactory DEPLOYMENT_FACTORY =
NettyHttpServerAdapter.SPI_PROVIDER
- .getSPI(DeploymentModelFactory.class);
-
- /** Request handler factory. */
- private static final NettyRequestHandlerFactory<NettyRequestHandlerImpl>
REQUEST_HANDLER_FACTORY = NettyRequestHandlerFactoryImpl
- .getInstance();
-
- /**
- * Constructor.
- */
- public NettyHttpServerAdapter()
- {
- super();
- }
-
- /**
- * @see HttpServer#createContext(String)
- *
- * @param ctx context root
- * @return http context
- */
- public HttpContext createContext(final String ctx)
- {
- return NettyHttpServerAdapter.HTTP_CONTEXT_FACTORY.newHttpContext(this, ctx);
- }
-
- /**
- * @see HttpServer#publish(HttpContext, Endpoint)
- *
- * @param ctx server context
- * @param endpoint web service endpoint
- */
- public void publish(final HttpContext ctx, final Endpoint endpoint)
- {
- final EndpointImpl epImpl = (EndpointImpl) endpoint;
- final String contextRoot = ctx.getContextRoot();
- final Deployment dep = this.newDeployment(epImpl, contextRoot);
-
- final DeploymentAspectManagerImpl daManager = new DeploymentAspectManagerImpl();
- daManager.setDeploymentAspects(this.getDeploymentAspects());
- daManager.deploy(dep);
- epImpl.setDeployment(dep);
-
- final NettyHttpServer server =
NettyHttpServerFactory.getNettyHttpServer(epImpl.getPort(),
NettyHttpServerAdapter.REQUEST_HANDLER_FACTORY);
- final NettyCallbackHandler callback = new
NettyCallbackHandlerImpl(epImpl.getPath(), contextRoot, this
- .getEndpointRegistryPath(epImpl));
- server.registerCallback(callback);
- }
-
- /**
- * @see HttpServer#destroy(HttpContext, Endpoint)
- *
- * @param ctx server context
- * @param endpoint web service endpoint
- */
- public void destroy(final HttpContext ctx, final Endpoint endpoint)
- {
- final EndpointImpl epImpl = (EndpointImpl) endpoint;
- final NettyHttpServer server =
NettyHttpServerFactory.getNettyHttpServer(epImpl.getPort(),
NettyHttpServerAdapter.REQUEST_HANDLER_FACTORY);
- final NettyCallbackHandler callback = server.getCallback(epImpl.getPath());
- server.unregisterCallback(callback);
-
- final DeploymentAspectManagerImpl daManager = new DeploymentAspectManagerImpl();
- daManager.setDeploymentAspects(this.getDeploymentAspects());
- daManager.undeploy(epImpl.getDeployment());
- }
-
- /**
- * Returns endpoint registry path. This path includes also port endpoint is running
on.
- *
- * @param endpoint endpoint
- * @return endpoint registry path
- */
- private String getEndpointRegistryPath(final EndpointImpl endpoint)
- {
- // we need to distinguish ports in endpoints registry in JSE environment
- return endpoint.getPath() + "-port-" + endpoint.getPort();
- }
-
- /**
- * Creates new deployment.
- *
- * @param epImpl endpoint implementation
- * @param contextRoot context root
- * @return deployment model
- */
- private Deployment newDeployment(final EndpointImpl epImpl, final String contextRoot)
- {
- final Class<?> endpointClass = this.getEndpointClass(epImpl);
- final ClassLoader loader = endpointClass.getClassLoader();
-
- final ArchiveDeployment dep = (ArchiveDeployment)
NettyHttpServerAdapter.DEPLOYMENT_FACTORY.newDeployment(contextRoot, loader);
- final org.jboss.wsf.spi.deployment.Endpoint endpoint =
NettyHttpServerAdapter.DEPLOYMENT_FACTORY.newEndpoint(endpointClass.getName());
- endpoint.setShortName(this.getEndpointRegistryPath(epImpl));
- endpoint.setURLPattern(epImpl.getPathWithoutContext());
- dep.getService().addEndpoint(endpoint);
- dep.setRootFile(new ResourceLoaderAdapter(loader));
- dep.setRuntimeClassLoader(loader);
- dep.setType(DeploymentType.JAXWS_JSE);
- dep.getService().setContextRoot(contextRoot);
-
- // TODO: remove this properties hack
- dep.getService().setProperty("protocol", "http");
- dep.getService().setProperty("host", "127.0.0.1");
- dep.getService().setProperty("port", epImpl.getPort());
-
- return dep;
- }
-
- /**
- * Returns deployment aspects needed to create deployment model.
- *
- * @return deployment aspects
- */
- private List<DeploymentAspect> getDeploymentAspects()
- {
- final List<DeploymentAspect> retVal = new
LinkedList<DeploymentAspect>();
-
- // TODO: native stack can't use framework classes directly
- retVal.add(new EndpointHandlerDeploymentAspect());
- retVal.add(new BackwardCompatibleContextRootDeploymentAspect());
- retVal.add(new URLPatternDeploymentAspect());
- retVal.add(new EndpointAddressDeploymentAspect());
- retVal.add(new EndpointNameDeploymentAspect());
- retVal.add(new UnifiedMetaDataDeploymentAspect());
- retVal.add(new ServiceEndpointInvokerDeploymentAspect());
- retVal.add(new PublishContractDeploymentAspect());
- retVal.add(new EagerInitializeDeploymentAspect());
- retVal.add(new EndpointRegistryDeploymentAspect());
- retVal.add(new EndpointLifecycleDeploymentAspect());
-
- return retVal;
- }
-
- /**
- * Returns implementor class associated with endpoint.
- *
- * @param endpoint to get implementor class from
- * @return implementor class
- */
- private Class<?> getEndpointClass(final Endpoint endpoint)
- {
- final Object implementor = endpoint.getImplementor();
- return implementor instanceof Class<?> ? (Class<?>) implementor :
implementor.getClass();
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.ws.Endpoint;
+
+import org.jboss.ws.core.jaxws.spi.EndpointImpl;
+import org.jboss.ws.core.server.netty.NettyCallbackHandler;
+import org.jboss.ws.core.server.netty.NettyHttpServer;
+import org.jboss.ws.core.server.netty.NettyHttpServerFactory;
+import org.jboss.ws.core.server.netty.NettyRequestHandlerFactory;
+import org.jboss.wsf.common.ResourceLoaderAdapter;
+import org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect;
+import org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl;
+import org.jboss.wsf.framework.deployment.EndpointAddressDeploymentAspect;
+import org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect;
+import org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect;
+import org.jboss.wsf.framework.deployment.EndpointNameDeploymentAspect;
+import org.jboss.wsf.framework.deployment.EndpointRegistryDeploymentAspect;
+import org.jboss.wsf.framework.deployment.URLPatternDeploymentAspect;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect;
+import org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect;
+import org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeploymentAspect;
+import org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect;
+
+/**
+ * Netty HTTP server adapter.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class NettyHttpServerAdapter implements HttpServer
+{
+
+ /** JBossWS SPI provider. */
+ private static final SPIProvider SPI_PROVIDER =
SPIProviderResolver.getInstance().getProvider();
+
+ /** JBossWS Http Context factory. */
+ private static final HttpContextFactory HTTP_CONTEXT_FACTORY =
NettyHttpServerAdapter.SPI_PROVIDER
+ .getSPI(HttpContextFactory.class);
+
+ /** Deployment model factory. */
+ private static final DeploymentModelFactory DEPLOYMENT_FACTORY =
NettyHttpServerAdapter.SPI_PROVIDER
+ .getSPI(DeploymentModelFactory.class);
+
+ /** Request handler factory. */
+ private static final NettyRequestHandlerFactory<NettyRequestHandlerImpl>
REQUEST_HANDLER_FACTORY = NettyRequestHandlerFactoryImpl
+ .getInstance();
+
+ /**
+ * Constructor.
+ */
+ public NettyHttpServerAdapter()
+ {
+ super();
+ }
+
+ /**
+ * @see HttpServer#createContext(String)
+ *
+ * @param ctx context root
+ * @return http context
+ */
+ public HttpContext createContext(final String ctx)
+ {
+ return NettyHttpServerAdapter.HTTP_CONTEXT_FACTORY.newHttpContext(this, ctx);
+ }
+
+ /**
+ * @see HttpServer#publish(HttpContext, Endpoint)
+ *
+ * @param ctx server context
+ * @param endpoint web service endpoint
+ */
+ public void publish(final HttpContext ctx, final Endpoint endpoint)
+ {
+ final EndpointImpl epImpl = (EndpointImpl) endpoint;
+ final String contextRoot = ctx.getContextRoot();
+ final Deployment dep = this.newDeployment(epImpl, contextRoot);
+
+ final DeploymentAspectManagerImpl daManager = new DeploymentAspectManagerImpl();
+ daManager.setDeploymentAspects(this.getDeploymentAspects());
+ daManager.deploy(dep);
+ epImpl.setDeployment(dep);
+
+ final NettyHttpServer server =
NettyHttpServerFactory.getNettyHttpServer(epImpl.getPort(),
NettyHttpServerAdapter.REQUEST_HANDLER_FACTORY);
+ final NettyCallbackHandler callback = new
NettyCallbackHandlerImpl(epImpl.getPath(), contextRoot, this
+ .getEndpointRegistryPath(epImpl));
+ server.registerCallback(callback);
+ }
+
+ /**
+ * @see HttpServer#destroy(HttpContext, Endpoint)
+ *
+ * @param ctx server context
+ * @param endpoint web service endpoint
+ */
+ public void destroy(final HttpContext ctx, final Endpoint endpoint)
+ {
+ final EndpointImpl epImpl = (EndpointImpl) endpoint;
+ final NettyHttpServer server =
NettyHttpServerFactory.getNettyHttpServer(epImpl.getPort(),
NettyHttpServerAdapter.REQUEST_HANDLER_FACTORY);
+ final NettyCallbackHandler callback = server.getCallback(epImpl.getPath());
+ server.unregisterCallback(callback);
+
+ final DeploymentAspectManagerImpl daManager = new DeploymentAspectManagerImpl();
+ daManager.setDeploymentAspects(this.getDeploymentAspects());
+ daManager.undeploy(epImpl.getDeployment());
+ }
+
+ /**
+ * Returns endpoint registry path. This path includes also port endpoint is running
on.
+ *
+ * @param endpoint endpoint
+ * @return endpoint registry path
+ */
+ private String getEndpointRegistryPath(final EndpointImpl endpoint)
+ {
+ // we need to distinguish ports in endpoints registry in JSE environment
+ return endpoint.getPath() + "-port-" + endpoint.getPort();
+ }
+
+ /**
+ * Creates new deployment.
+ *
+ * @param epImpl endpoint implementation
+ * @param contextRoot context root
+ * @return deployment model
+ */
+ private Deployment newDeployment(final EndpointImpl epImpl, final String contextRoot)
+ {
+ final Class<?> endpointClass = this.getEndpointClass(epImpl);
+ final ClassLoader loader = endpointClass.getClassLoader();
+
+ final ArchiveDeployment dep = (ArchiveDeployment)
NettyHttpServerAdapter.DEPLOYMENT_FACTORY.newDeployment(contextRoot, loader);
+ final org.jboss.wsf.spi.deployment.Endpoint endpoint =
NettyHttpServerAdapter.DEPLOYMENT_FACTORY.newEndpoint(endpointClass.getName());
+ endpoint.setShortName(this.getEndpointRegistryPath(epImpl));
+ endpoint.setURLPattern(epImpl.getPathWithoutContext());
+ dep.getService().addEndpoint(endpoint);
+ dep.setRootFile(new ResourceLoaderAdapter(loader));
+ dep.setRuntimeClassLoader(loader);
+ dep.setType(DeploymentType.JAXWS_JSE);
+ dep.getService().setContextRoot(contextRoot);
+
+ // TODO: remove this properties hack
+ dep.getService().setProperty("protocol", "http");
+ dep.getService().setProperty("host", "127.0.0.1");
+ dep.getService().setProperty("port", epImpl.getPort());
+
+ return dep;
+ }
+
+ /**
+ * Returns deployment aspects needed to create deployment model.
+ *
+ * @return deployment aspects
+ */
+ private List<DeploymentAspect> getDeploymentAspects()
+ {
+ final List<DeploymentAspect> retVal = new
LinkedList<DeploymentAspect>();
+
+ // TODO: native stack can't use framework classes directly
+ retVal.add(new EndpointHandlerDeploymentAspect());
+ retVal.add(new BackwardCompatibleContextRootDeploymentAspect());
+ retVal.add(new URLPatternDeploymentAspect());
+ retVal.add(new EndpointAddressDeploymentAspect());
+ retVal.add(new EndpointNameDeploymentAspect());
+ retVal.add(new UnifiedMetaDataDeploymentAspect());
+ retVal.add(new ServiceEndpointInvokerDeploymentAspect());
+ retVal.add(new PublishContractDeploymentAspect());
+ retVal.add(new EagerInitializeDeploymentAspect());
+ retVal.add(new EndpointRegistryDeploymentAspect());
+ retVal.add(new EndpointLifecycleDeploymentAspect());
+
+ return retVal;
+ }
+
+ /**
+ * Returns implementor class associated with endpoint.
+ *
+ * @param endpoint to get implementor class from
+ * @return implementor class
+ */
+ private Class<?> getEndpointClass(final Endpoint endpoint)
+ {
+ final Object implementor = endpoint.getImplementor();
+ return implementor instanceof Class<?> ? (Class<?>) implementor :
implementor.getClass();
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,195 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import java.io.File;
-import java.net.UnknownHostException;
-
-import org.jboss.ws.WSException;
-import org.jboss.wsf.spi.management.ServerConfig;
-
-/**
- * Netty HTTP server config that configures user temp
- * directory to be used for contract publishing.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class NettyHttpServerConfig implements ServerConfig
-{
-
- /** Temporary directory location. */
- private static File tmpDir;
-
- static
- {
- try
- {
- NettyHttpServerConfig.tmpDir = new
File(System.getProperty("java.io.tmpdir"));
- }
- catch (SecurityException se)
- {
- throw new WSException(se);
- }
- }
-
- /**
- * Constructor.
- */
- public NettyHttpServerConfig()
- {
- super();
- }
-
- /**
- * @see ServerConfig#getServerHomeDir()
- *
- * @return server home directory
- */
- public File getHomeDir()
- {
- return NettyHttpServerConfig.tmpDir;
- }
-
- /**
- * @see ServerConfig#getServerDataDir()
- *
- * @return server data directory
- */
- public File getServerDataDir()
- {
- return NettyHttpServerConfig.tmpDir;
- }
-
- /**
- * @see ServerConfig#getServerTempDir()
- *
- * @return server temp directory
- */
- public File getServerTempDir()
- {
- return NettyHttpServerConfig.tmpDir;
- }
-
- /**
- * @see ServerConfig#getWebServiceHost()
- *
- * @return localhost
- */
- public String getWebServiceHost()
- {
- return "localhost";
- }
-
- /**
- * @see ServerConfig#isModifySOAPAddress()
- *
- * @return always return false
- */
- public boolean isModifySOAPAddress()
- {
- return false;
- }
-
- // not implemented methods
-
- /**
- * Not implemented.
- *
- * @return string
- */
- public String getImplementationTitle()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Not implemented.
- *
- * @return string
- */
- public String getImplementationVersion()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Not implemented.
- *
- * @return int
- */
- public int getWebServicePort()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Not implemented.
- *
- * @return int
- */
- public int getWebServiceSecurePort()
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Not implemented.
- *
- * @param flag boolean
- */
- public void setModifySOAPAddress(final boolean flag)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Not implemented.
- *
- * @param host string
- * @throws UnknownHostException never thrown
- */
- public void setWebServiceHost(final String host) throws UnknownHostException
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Not implemented.
- *
- * @param port int
- */
- public void setWebServicePort(final int port)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Not implemented.
- *
- * @param port int
- */
- public void setWebServiceSecurePort(final int port)
- {
- throw new UnsupportedOperationException();
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,195 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import java.io.File;
+import java.net.UnknownHostException;
+
+import org.jboss.ws.WSException;
+import org.jboss.wsf.spi.management.ServerConfig;
+
+/**
+ * Netty HTTP server config that configures user temp
+ * directory to be used for contract publishing.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class NettyHttpServerConfig implements ServerConfig
+{
+
+ /** Temporary directory location. */
+ private static File tmpDir;
+
+ static
+ {
+ try
+ {
+ NettyHttpServerConfig.tmpDir = new
File(System.getProperty("java.io.tmpdir"));
+ }
+ catch (SecurityException se)
+ {
+ throw new WSException(se);
+ }
+ }
+
+ /**
+ * Constructor.
+ */
+ public NettyHttpServerConfig()
+ {
+ super();
+ }
+
+ /**
+ * @see ServerConfig#getServerHomeDir()
+ *
+ * @return server home directory
+ */
+ public File getHomeDir()
+ {
+ return NettyHttpServerConfig.tmpDir;
+ }
+
+ /**
+ * @see ServerConfig#getServerDataDir()
+ *
+ * @return server data directory
+ */
+ public File getServerDataDir()
+ {
+ return NettyHttpServerConfig.tmpDir;
+ }
+
+ /**
+ * @see ServerConfig#getServerTempDir()
+ *
+ * @return server temp directory
+ */
+ public File getServerTempDir()
+ {
+ return NettyHttpServerConfig.tmpDir;
+ }
+
+ /**
+ * @see ServerConfig#getWebServiceHost()
+ *
+ * @return localhost
+ */
+ public String getWebServiceHost()
+ {
+ return "localhost";
+ }
+
+ /**
+ * @see ServerConfig#isModifySOAPAddress()
+ *
+ * @return always return false
+ */
+ public boolean isModifySOAPAddress()
+ {
+ return false;
+ }
+
+ // not implemented methods
+
+ /**
+ * Not implemented.
+ *
+ * @return string
+ */
+ public String getImplementationTitle()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not implemented.
+ *
+ * @return string
+ */
+ public String getImplementationVersion()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not implemented.
+ *
+ * @return int
+ */
+ public int getWebServicePort()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not implemented.
+ *
+ * @return int
+ */
+ public int getWebServiceSecurePort()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not implemented.
+ *
+ * @param flag boolean
+ */
+ public void setModifySOAPAddress(final boolean flag)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not implemented.
+ *
+ * @param host string
+ * @throws UnknownHostException never thrown
+ */
+ public void setWebServiceHost(final String host) throws UnknownHostException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not implemented.
+ *
+ * @param port int
+ */
+ public void setWebServicePort(final int port)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not implemented.
+ *
+ * @param port int
+ */
+ public void setWebServiceSecurePort(final int port)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-
-/**
- * Netty server configuration factory.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class NettyHttpServerConfigFactory extends ServerConfigFactory
-{
-
- /** Netty config singleton. */
- private static final ServerConfig NETTY_CONFIG_SINGLETON = new
NettyHttpServerConfig();
-
- /**
- * Constructor.
- */
- public NettyHttpServerConfigFactory()
- {
- super();
- }
-
- /**
- * Provides Netty server configuration.
- *
- * @return Netty server configuration
- */
- @Override
- public ServerConfig getServerConfig()
- {
- return NettyHttpServerConfigFactory.NETTY_CONFIG_SINGLETON;
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+
+/**
+ * Netty server configuration factory.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class NettyHttpServerConfigFactory extends ServerConfigFactory
+{
+
+ /** Netty config singleton. */
+ private static final ServerConfig NETTY_CONFIG_SINGLETON = new
NettyHttpServerConfig();
+
+ /**
+ * Constructor.
+ */
+ public NettyHttpServerConfigFactory()
+ {
+ super();
+ }
+
+ /**
+ * Provides Netty server configuration.
+ *
+ * @return Netty server configuration
+ */
+ @Override
+ public ServerConfig getServerConfig()
+ {
+ return NettyHttpServerConfigFactory.NETTY_CONFIG_SINGLETON;
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.http.HttpServerFactory;
-
-/**
- * @see org.jboss.wsf.spi.http.HttpServerFactory
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class NettyHttpServerFactory extends HttpServerFactory
-{
-
- /** Netty HTTP server adapter singleton. */
- private static final HttpServer NETTY_SERVER_ADAPTER_SINGLETON = new
NettyHttpServerAdapter();
-
- /**
- * Constructor.
- */
- public NettyHttpServerFactory()
- {
- super();
- }
-
- /**
- * Returns Netty based http server adapter.
- *
- * @return Netty based http server adapter
- */
- @Override
- public HttpServer getHttpServer()
- {
- return NettyHttpServerFactory.NETTY_SERVER_ADAPTER_SINGLETON;
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+
+/**
+ * @see org.jboss.wsf.spi.http.HttpServerFactory
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class NettyHttpServerFactory extends HttpServerFactory
+{
+
+ /** Netty HTTP server adapter singleton. */
+ private static final HttpServer NETTY_SERVER_ADAPTER_SINGLETON = new
NettyHttpServerAdapter();
+
+ /**
+ * Constructor.
+ */
+ public NettyHttpServerFactory()
+ {
+ super();
+ }
+
+ /**
+ * Returns Netty based http server adapter.
+ *
+ * @return Netty based http server adapter
+ */
+ @Override
+ public HttpServer getHttpServer()
+ {
+ return NettyHttpServerFactory.NETTY_SERVER_ADAPTER_SINGLETON;
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
-import org.jboss.wsf.spi.invocation.InvocationType;
-
-/**
- * Netty invocation handler factory that supports JAXWS JSE invocation only.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class NettyInvocationHandlerFactory extends InvocationHandlerFactory
-{
-
- /**
- * Constructor.
- */
- public NettyInvocationHandlerFactory()
- {
- super();
- }
-
- /**
- * Returns invocation handler for specified invocation type.
- *
- * @param type invocation type
- * @return invocation handler
- */
- @Override
- public InvocationHandler newInvocationHandler(final InvocationType type)
- {
- InvocationHandler handler = null;
-
- switch (type)
- {
- case JAXWS_JSE :
- handler = new InvocationHandlerJAXWS();
- break;
- default :
- throw new IllegalArgumentException("Unable to resolve
spi.invocation.InvocationHandler for type: " + type);
- }
-
- return handler;
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
+import org.jboss.wsf.spi.invocation.InvocationType;
+
+/**
+ * Netty invocation handler factory that supports JAXWS JSE invocation only.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class NettyInvocationHandlerFactory extends InvocationHandlerFactory
+{
+
+ /**
+ * Constructor.
+ */
+ public NettyInvocationHandlerFactory()
+ {
+ super();
+ }
+
+ /**
+ * Returns invocation handler for specified invocation type.
+ *
+ * @param type invocation type
+ * @return invocation handler
+ */
+ @Override
+ public InvocationHandler newInvocationHandler(final InvocationType type)
+ {
+ InvocationHandler handler = null;
+
+ switch (type)
+ {
+ case JAXWS_JSE :
+ handler = new InvocationHandlerJAXWS();
+ break;
+ default :
+ throw new IllegalArgumentException("Unable to resolve
spi.invocation.InvocationHandler for type: " + type);
+ }
+
+ return handler;
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import org.jboss.ws.core.server.netty.NettyRequestHandlerFactory;
-
-/**
- * Netty request handler factory for endpoint publish API.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class NettyRequestHandlerFactoryImpl implements
NettyRequestHandlerFactory<NettyRequestHandlerImpl>
-{
-
- /** Factory singleton. */
- private static final NettyRequestHandlerFactory<NettyRequestHandlerImpl>
SINGLETON = new NettyRequestHandlerFactoryImpl();
-
- /**
- * Constructor.
- */
- private NettyRequestHandlerFactoryImpl()
- {
- super();
- }
-
- /**
- * Creates new request handler.
- *
- * @return new request handler
- */
- public NettyRequestHandlerImpl newNettyRequestHandler()
- {
- return new NettyRequestHandlerImpl();
- }
-
- /**
- * Returns factory instance.
- *
- * @return factory instance
- */
- public static NettyRequestHandlerFactory<NettyRequestHandlerImpl> getInstance()
- {
- return NettyRequestHandlerFactoryImpl.SINGLETON;
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerFactoryImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import org.jboss.ws.core.server.netty.NettyRequestHandlerFactory;
+
+/**
+ * Netty request handler factory for endpoint publish API.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class NettyRequestHandlerFactoryImpl implements
NettyRequestHandlerFactory<NettyRequestHandlerImpl>
+{
+
+ /** Factory singleton. */
+ private static final NettyRequestHandlerFactory<NettyRequestHandlerImpl>
SINGLETON = new NettyRequestHandlerFactoryImpl();
+
+ /**
+ * Constructor.
+ */
+ private NettyRequestHandlerFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Creates new request handler.
+ *
+ * @return new request handler
+ */
+ public NettyRequestHandlerImpl newNettyRequestHandler()
+ {
+ return new NettyRequestHandlerImpl();
+ }
+
+ /**
+ * Returns factory instance.
+ *
+ * @return factory instance
+ */
+ public static NettyRequestHandlerFactory<NettyRequestHandlerImpl> getInstance()
+ {
+ return NettyRequestHandlerFactoryImpl.SINGLETON;
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,179 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.spi.http;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.jboss.logging.Logger;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.MessageEvent;
-import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
-import org.jboss.netty.handler.codec.http.HttpHeaders;
-import org.jboss.netty.handler.codec.http.HttpRequest;
-import org.jboss.netty.handler.codec.http.HttpResponse;
-import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import org.jboss.netty.handler.codec.http.HttpVersion;
-import org.jboss.ws.Constants;
-import org.jboss.ws.core.server.netty.AbstractNettyRequestHandler;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Netty request handler for endpoint publish API.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class NettyRequestHandlerImpl extends AbstractNettyRequestHandler
-{
- /** Logger. */
- private static final Logger LOG = Logger.getLogger(NettyRequestHandlerImpl.class);
-
- /**
- * Constructor.
- */
- public NettyRequestHandlerImpl()
- {
- super();
- }
-
- /**
- * Callback method called by Netty HTTP server.
- *
- * @param ctx channel handler context
- * @param event message event
- * @throws Exception
- */
- @Override
- public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent
event)
- {
- // TODO: create custom HttpNettyRequest and don't use Netty provided default
impl.
- final HttpRequest request = (HttpRequest) event.getMessage();
- if (HttpVersion.HTTP_1_1.equals(request.getProtocolVersion()))
- {
- final AbstractNettyMessage message = new NettyHttp11Message(ctx.getChannel(),
request);
-
- final InvocationContext invCtx = new InvocationContext();
- invCtx.setProperty(Constants.NETTY_MESSAGE, message);
- try
- {
- final String requestPath = this.getRequestPath(request.getUri());
- final String httpMethod = request.getMethod().getName();
- this.handle(requestPath, httpMethod, message.getInputStream(),
message.getOutputStream(), invCtx);
- }
- catch (Exception e)
- {
- NettyRequestHandlerImpl.LOG.error(e);
- this.sendError(event, HttpResponseStatus.INTERNAL_SERVER_ERROR);
- }
- }
- else
- {
- NettyRequestHandlerImpl.LOG.fatal("HTTP 1.0 not supported");
- this.sendError(event, HttpResponseStatus.NOT_IMPLEMENTED);
- }
- }
-
- /**
- * Calls Netty callback handler associated with request path.
- *
- * @param requestPath to handle
- * @param httpMethod http method (GET or POST)
- * @param is input stream
- * @param os output stream
- * @param invCtx invocation context
- * @throws IOException if some I/O error occurs
- */
- private void handle(final String requestPath, final String httpMethod, final
InputStream is,
- final OutputStream os, final InvocationContext invCtx) throws IOException
- {
- final NettyCallbackHandlerImpl handler = (NettyCallbackHandlerImpl)
this.getCallback(requestPath);
- if (handler != null)
- {
- handler.handle(httpMethod, is, os, invCtx);
- }
- else
- {
- final String errorMessage = "No callback handler registered for path:
" + requestPath;
- NettyRequestHandlerImpl.LOG.warn(errorMessage);
- throw new IllegalArgumentException(errorMessage);
- }
- }
-
- /**
- * Sends error to HTTP client.
- *
- * @param event message event
- * @param statusCode HTTP status code
- */
- private void sendError(final MessageEvent event, final HttpResponseStatus statusCode)
- {
- // Build the response object.
- final HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1,
statusCode);
- response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/plain;
charset=UTF-8");
-
- // Write the response.
- event.getChannel().write(response).awaitUninterruptibly();
- }
-
- /**
- * Returns request path without query string.
- *
- * @param requestPath to parse
- * @return request path without query string
- */
- private String getRequestPath(final String requestPath)
- {
- String retVal = requestPath;
-
- // remove query string if available
- final int paramIndex = retVal.indexOf('?');
- if (paramIndex != -1)
- {
- retVal = retVal.substring(0, paramIndex);
- }
-
- // remove protocol, host and port if available
- if (retVal.startsWith("http"))
- {
- try
- {
- retVal = new URL(retVal).getPath();
- }
- catch (MalformedURLException mue)
- {
- NettyRequestHandlerImpl.LOG.error(mue.getMessage(), mue);
- }
- }
-
- // remove '/' characters at the end
- while (retVal.endsWith("/"))
- {
- retVal = retVal.substring(0, retVal.length() - 1);
- }
-
- return retVal;
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyRequestHandlerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.spi.http;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.logging.Logger;
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.MessageEvent;
+import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
+import org.jboss.netty.handler.codec.http.HttpRequest;
+import org.jboss.netty.handler.codec.http.HttpResponse;
+import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import org.jboss.netty.handler.codec.http.HttpVersion;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.server.netty.AbstractNettyRequestHandler;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+
+/**
+ * Netty request handler for endpoint publish API.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class NettyRequestHandlerImpl extends AbstractNettyRequestHandler
+{
+ /** Logger. */
+ private static final Logger LOG = Logger.getLogger(NettyRequestHandlerImpl.class);
+
+ /**
+ * Constructor.
+ */
+ public NettyRequestHandlerImpl()
+ {
+ super();
+ }
+
+ /**
+ * Callback method called by Netty HTTP server.
+ *
+ * @param ctx channel handler context
+ * @param event message event
+ * @throws Exception
+ */
+ @Override
+ public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent
event)
+ {
+ // TODO: create custom HttpNettyRequest and don't use Netty provided default
impl.
+ final HttpRequest request = (HttpRequest) event.getMessage();
+ if (HttpVersion.HTTP_1_1.equals(request.getProtocolVersion()))
+ {
+ final AbstractNettyMessage message = new NettyHttp11Message(ctx.getChannel(),
request);
+
+ final InvocationContext invCtx = new InvocationContext();
+ invCtx.setProperty(Constants.NETTY_MESSAGE, message);
+ try
+ {
+ final String requestPath = this.getRequestPath(request.getUri());
+ final String httpMethod = request.getMethod().getName();
+ this.handle(requestPath, httpMethod, message.getInputStream(),
message.getOutputStream(), invCtx);
+ }
+ catch (Exception e)
+ {
+ NettyRequestHandlerImpl.LOG.error(e);
+ this.sendError(event, HttpResponseStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+ else
+ {
+ NettyRequestHandlerImpl.LOG.fatal("HTTP 1.0 not supported");
+ this.sendError(event, HttpResponseStatus.NOT_IMPLEMENTED);
+ }
+ }
+
+ /**
+ * Calls Netty callback handler associated with request path.
+ *
+ * @param requestPath to handle
+ * @param httpMethod http method (GET or POST)
+ * @param is input stream
+ * @param os output stream
+ * @param invCtx invocation context
+ * @throws IOException if some I/O error occurs
+ */
+ private void handle(final String requestPath, final String httpMethod, final
InputStream is,
+ final OutputStream os, final InvocationContext invCtx) throws IOException
+ {
+ final NettyCallbackHandlerImpl handler = (NettyCallbackHandlerImpl)
this.getCallback(requestPath);
+ if (handler != null)
+ {
+ handler.handle(httpMethod, is, os, invCtx);
+ }
+ else
+ {
+ final String errorMessage = "No callback handler registered for path:
" + requestPath;
+ NettyRequestHandlerImpl.LOG.warn(errorMessage);
+ throw new IllegalArgumentException(errorMessage);
+ }
+ }
+
+ /**
+ * Sends error to HTTP client.
+ *
+ * @param event message event
+ * @param statusCode HTTP status code
+ */
+ private void sendError(final MessageEvent event, final HttpResponseStatus statusCode)
+ {
+ // Build the response object.
+ final HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1,
statusCode);
+ response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/plain;
charset=UTF-8");
+
+ // Write the response.
+ event.getChannel().write(response).awaitUninterruptibly();
+ }
+
+ /**
+ * Returns request path without query string.
+ *
+ * @param requestPath to parse
+ * @return request path without query string
+ */
+ private String getRequestPath(final String requestPath)
+ {
+ String retVal = requestPath;
+
+ // remove query string if available
+ final int paramIndex = retVal.indexOf('?');
+ if (paramIndex != -1)
+ {
+ retVal = retVal.substring(0, paramIndex);
+ }
+
+ // remove protocol, host and port if available
+ if (retVal.startsWith("http"))
+ {
+ try
+ {
+ retVal = new URL(retVal).getPath();
+ }
+ catch (MalformedURLException mue)
+ {
+ NettyRequestHandlerImpl.LOG.error(mue.getMessage(), mue);
+ }
+ }
+
+ // remove '/' characters at the end
+ while (retVal.endsWith("/"))
+ {
+ retVal = retVal.substring(0, retVal.length() - 1);
+ }
+
+ return retVal;
+ }
+
+}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -218,14 +218,14 @@
URL orgURL = new URL(orgLocation);
String protocol = orgURL.getProtocol();
String host = orgURL.getHost();
- int port = getPortForProtocol(protocol);
- String path = orgURL.getPath();
final boolean rewriteLocation =
ServerConfig.UNDEFINED_HOSTNAME.equals(host) ||
this.config.isModifySOAPAddress();
-
+
if (rewriteLocation)
{
+ int port = getPortForProtocol(protocol);
+ String path = orgURL.getPath();
String newLocation = new URL(protocol, wsdlHost, port,
path).toString();
if (!newLocation.equals(orgLocation))
{
Copied: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty (from
rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty)
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,183 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server.netty;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ChannelPipelineCoverage;
-import org.jboss.netty.channel.ChannelStateEvent;
-import org.jboss.netty.channel.ExceptionEvent;
-import org.jboss.netty.channel.MessageEvent;
-import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
-
-/**
- * Abstract Netty request handler.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:asoldano@redhat.com">Alessio
Soldano</a>
- */
-@ChannelPipelineCoverage("one")
-public abstract class AbstractNettyRequestHandler extends SimpleChannelUpstreamHandler
-{
-
- /** Callbacks registry. */
- private final List<NettyCallbackHandler> callbacks = new
LinkedList<NettyCallbackHandler>();
-
- /** Callback registry lock. */
- private final Lock callbackRegistryLock = new ReentrantLock();
-
- /**
- * Constructor.
- */
- protected AbstractNettyRequestHandler()
- {
- super();
- }
-
- /**
- * Template method implementation.
- *
- * @param ctx channel handler context
- * @param e channel state event
- */
- @Override
- public final void channelOpen(final ChannelHandlerContext ctx, final ChannelStateEvent
e)
- {
- // HERE: Add all accepted channels to the group
- // so that they are closed properly on shutdown
- // If the added channel is closed before shutdown,
- // it will be removed from the group automatically.
- NettyHttpServerImpl.NETTY_CHANNEL_GROUP.add(ctx.getChannel());
- }
-
- /**
- * Template method implementation.
- *
- * @param ctx channel handler context
- * @param e exception event
- * @throws Exception if some error occurs
- */
- @Override
- public final void exceptionCaught(final ChannelHandlerContext ctx, final
ExceptionEvent e) throws Exception
- {
- e.getCause().printStackTrace();
- e.getChannel().close();
- }
-
- /**
- * Template method for processing incoming requests.
- *
- * @param ctx channel handler context
- * @param e message event
- * @throws Exception if some error occurs
- */
- @Override
- public abstract void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws
Exception;
-
- /**
- * Returns true if request handler have at least one callback registered, false
otherwise.
- *
- * @return true if at least one callback is registered, false otherwise
- */
- public final boolean hasMoreCallbacks()
- {
- this.callbackRegistryLock.lock();
- try
- {
- return this.callbacks.size() > 0;
- }
- finally
- {
- this.callbackRegistryLock.unlock();
- }
- }
-
- /**
- * Returns callback handler associated with request path.
- *
- * @param requestPath to get handler for
- * @return callback handler
- */
- public final NettyCallbackHandler getCallback(final String requestPath)
- {
- this.callbackRegistryLock.lock();
- try
- {
- for (final NettyCallbackHandler handler : this.callbacks)
- {
- if (handler.getPath().equals(requestPath))
- {
- return handler;
- }
- }
- }
- finally
- {
- this.callbackRegistryLock.unlock();
- }
-
- return null;
- }
-
- /**
- * Registers callback.
- *
- * @param callback netty callback
- */
- public final void registerCallback(final NettyCallbackHandler callback)
- {
- this.callbackRegistryLock.lock();
- try
- {
- callback.init();
- this.callbacks.add(callback);
- }
- finally
- {
- this.callbackRegistryLock.unlock();
- }
- }
-
- /**
- * Unregisters callback.
- *
- * @param callback netty callback
- */
- public final void unregisterCallback(final NettyCallbackHandler callback)
- {
- this.callbackRegistryLock.lock();
- try
- {
- this.callbacks.remove(callback);
- callback.destroy();
- }
- finally
- {
- this.callbackRegistryLock.unlock();
- }
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/AbstractNettyRequestHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.server.netty;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.ChannelPipelineCoverage;
+import org.jboss.netty.channel.ChannelStateEvent;
+import org.jboss.netty.channel.ExceptionEvent;
+import org.jboss.netty.channel.MessageEvent;
+import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
+
+/**
+ * Abstract Netty request handler.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:asoldano@redhat.com">Alessio
Soldano</a>
+ */
+@ChannelPipelineCoverage("one")
+public abstract class AbstractNettyRequestHandler extends SimpleChannelUpstreamHandler
+{
+
+ /** Callbacks registry. */
+ private final List<NettyCallbackHandler> callbacks = new
LinkedList<NettyCallbackHandler>();
+
+ /** Callback registry lock. */
+ private final Lock callbackRegistryLock = new ReentrantLock();
+
+ /**
+ * Constructor.
+ */
+ protected AbstractNettyRequestHandler()
+ {
+ super();
+ }
+
+ /**
+ * Template method implementation.
+ *
+ * @param ctx channel handler context
+ * @param e channel state event
+ */
+ @Override
+ public final void channelOpen(final ChannelHandlerContext ctx, final ChannelStateEvent
e)
+ {
+ // HERE: Add all accepted channels to the group
+ // so that they are closed properly on shutdown
+ // If the added channel is closed before shutdown,
+ // it will be removed from the group automatically.
+ NettyHttpServerImpl.NETTY_CHANNEL_GROUP.add(ctx.getChannel());
+ }
+
+ /**
+ * Template method implementation.
+ *
+ * @param ctx channel handler context
+ * @param e exception event
+ * @throws Exception if some error occurs
+ */
+ @Override
+ public final void exceptionCaught(final ChannelHandlerContext ctx, final
ExceptionEvent e) throws Exception
+ {
+ e.getCause().printStackTrace();
+ e.getChannel().close();
+ }
+
+ /**
+ * Template method for processing incoming requests.
+ *
+ * @param ctx channel handler context
+ * @param e message event
+ * @throws Exception if some error occurs
+ */
+ @Override
+ public abstract void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws
Exception;
+
+ /**
+ * Returns true if request handler have at least one callback registered, false
otherwise.
+ *
+ * @return true if at least one callback is registered, false otherwise
+ */
+ public final boolean hasMoreCallbacks()
+ {
+ this.callbackRegistryLock.lock();
+ try
+ {
+ return this.callbacks.size() > 0;
+ }
+ finally
+ {
+ this.callbackRegistryLock.unlock();
+ }
+ }
+
+ /**
+ * Returns callback handler associated with request path.
+ *
+ * @param requestPath to get handler for
+ * @return callback handler
+ */
+ public final NettyCallbackHandler getCallback(final String requestPath)
+ {
+ this.callbackRegistryLock.lock();
+ try
+ {
+ for (final NettyCallbackHandler handler : this.callbacks)
+ {
+ if (handler.getPath().equals(requestPath))
+ {
+ return handler;
+ }
+ }
+ }
+ finally
+ {
+ this.callbackRegistryLock.unlock();
+ }
+
+ return null;
+ }
+
+ /**
+ * Registers callback.
+ *
+ * @param callback netty callback
+ */
+ public final void registerCallback(final NettyCallbackHandler callback)
+ {
+ this.callbackRegistryLock.lock();
+ try
+ {
+ callback.init();
+ this.callbacks.add(callback);
+ }
+ finally
+ {
+ this.callbackRegistryLock.unlock();
+ }
+ }
+
+ /**
+ * Unregisters callback.
+ *
+ * @param callback netty callback
+ */
+ public final void unregisterCallback(final NettyCallbackHandler callback)
+ {
+ this.callbackRegistryLock.lock();
+ try
+ {
+ this.callbacks.remove(callback);
+ callback.destroy();
+ }
+ finally
+ {
+ this.callbackRegistryLock.unlock();
+ }
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server.netty;
-
-/**
- * Netty callback handler abstraction.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public interface NettyCallbackHandler
-{
-
- /**
- * Template method to initialize callback handler.
- */
- void init();
-
- /**
- * Returns path callback handler operates on.
- *
- * @return callback working path
- */
- String getPath();
-
- /**
- * Template method to destroy callback handler.
- */
- void destroy();
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyCallbackHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.server.netty;
+
+/**
+ * Netty callback handler abstraction.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public interface NettyCallbackHandler
+{
+
+ /**
+ * Template method to initialize callback handler.
+ */
+ void init();
+
+ /**
+ * Returns path callback handler operates on.
+ *
+ * @return callback working path
+ */
+ String getPath();
+
+ /**
+ * Template method to destroy callback handler.
+ */
+ void destroy();
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server.netty;
-
-/**
- * Netty Http Server abstraction.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public interface NettyHttpServer
-{
-
- /**
- * Registers new callback.
- *
- * @param callback netty callback
- */
- void registerCallback(NettyCallbackHandler callback);
-
- /**
- * Registers old callback.
- *
- * @param callback netty callback
- */
- void unregisterCallback(NettyCallbackHandler callback);
-
- /**
- * Returns registered callback associated with request path.
- *
- * @param requestPath request path to get associated callback for
- * @return callback handler
- */
- NettyCallbackHandler getCallback(String requestPath);
-
- /**
- * Returns true if server has some callbacks registered, false otherwise.
- *
- * @return true if callbacks are available, false otherwise
- */
- boolean hasMoreCallbacks();
-
- /**
- * Returns port this server runs on.
- *
- * @return server port
- */
- int getPort();
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServer.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.server.netty;
+
+/**
+ * Netty Http Server abstraction.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public interface NettyHttpServer
+{
+
+ /**
+ * Registers new callback.
+ *
+ * @param callback netty callback
+ */
+ void registerCallback(NettyCallbackHandler callback);
+
+ /**
+ * Registers old callback.
+ *
+ * @param callback netty callback
+ */
+ void unregisterCallback(NettyCallbackHandler callback);
+
+ /**
+ * Returns registered callback associated with request path.
+ *
+ * @param requestPath request path to get associated callback for
+ * @return callback handler
+ */
+ NettyCallbackHandler getCallback(String requestPath);
+
+ /**
+ * Returns true if server has some callbacks registered, false otherwise.
+ *
+ * @return true if callbacks are available, false otherwise
+ */
+ boolean hasMoreCallbacks();
+
+ /**
+ * Returns port this server runs on.
+ *
+ * @return server port
+ */
+ int getPort();
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server.netty;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Netty based http server factory.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class NettyHttpServerFactory
-{
-
- /**
- * Servers registry.
- */
- static final Map<Integer, NettyHttpServer> SERVERS = new HashMap<Integer,
NettyHttpServer>();
-
- /**
- * Constructor.
- */
- private NettyHttpServerFactory()
- {
- super();
- }
-
- /**
- * Starts Netty based http server on the background if method is called for the first
time,
- * otherwise returns already existing and running server instance.
- *
- * @param port server port
- * @param requestHandlerFactory request handle factory
- * @param <T> factory type
- * @return running Netty based http server
- */
- public static <T extends NettyRequestHandlerFactory<?>> NettyHttpServer
getNettyHttpServer(final int port,
- final T requestHandlerFactory)
- {
- if (port <= 0)
- {
- throw new IllegalArgumentException("Not positive port value");
- }
- if (requestHandlerFactory == null)
- {
- throw new NullPointerException("Factory cannot be null");
- }
-
- synchronized (NettyHttpServerFactory.SERVERS)
- {
- NettyHttpServer server = NettyHttpServerFactory.SERVERS.get(port);
- if (server == null)
- {
- server = new NettyHttpServerImpl(port, requestHandlerFactory);
- NettyHttpServerFactory.SERVERS.put(port, server);
- }
- return server;
- }
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.server.netty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Netty based http server factory.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class NettyHttpServerFactory
+{
+
+ /**
+ * Servers registry.
+ */
+ static final Map<Integer, NettyHttpServer> SERVERS = new HashMap<Integer,
NettyHttpServer>();
+
+ /**
+ * Constructor.
+ */
+ private NettyHttpServerFactory()
+ {
+ super();
+ }
+
+ /**
+ * Starts Netty based http server on the background if method is called for the first
time,
+ * otherwise returns already existing and running server instance.
+ *
+ * @param port server port
+ * @param requestHandlerFactory request handle factory
+ * @param <T> factory type
+ * @return running Netty based http server
+ */
+ public static <T extends NettyRequestHandlerFactory<?>> NettyHttpServer
getNettyHttpServer(final int port,
+ final T requestHandlerFactory)
+ {
+ if (port <= 0)
+ {
+ throw new IllegalArgumentException("Not positive port value");
+ }
+ if (requestHandlerFactory == null)
+ {
+ throw new NullPointerException("Factory cannot be null");
+ }
+
+ synchronized (NettyHttpServerFactory.SERVERS)
+ {
+ NettyHttpServer server = NettyHttpServerFactory.SERVERS.get(port);
+ if (server == null)
+ {
+ server = new NettyHttpServerImpl(port, requestHandlerFactory);
+ NettyHttpServerFactory.SERVERS.put(port, server);
+ }
+ return server;
+ }
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,255 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server.netty;
-
-import java.net.InetSocketAddress;
-import java.util.concurrent.Executors;
-
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.netty.bootstrap.ServerBootstrap;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelFactory;
-import org.jboss.netty.channel.group.ChannelGroup;
-import org.jboss.netty.channel.group.DefaultChannelGroup;
-import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
-import org.jboss.ws.core.client.transport.WSServerPipelineFactory;
-
-/**
- * Netty http server implementation.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:asoldano@redhat.com">Alessio
Soldano</a>
- */
-final class NettyHttpServerImpl implements NettyHttpServer, Runnable
-{
-
- /** Wait period. */
- private static final long WAIT_PERIOD = 100;
-
- /** Netty channel group. */
- static final ChannelGroup NETTY_CHANNEL_GROUP = new
DefaultChannelGroup("NettyHttpServer");
-
- /** Server port. */
- private final int port;
-
- /** Indicates server is stopped. */
- private boolean stopped;
-
- /** Indicates server is terminated. */
- private boolean terminated;
-
- /** Channel factory. */
- private ChannelFactory channelFactory;
-
- /** Netty request handler. */
- private AbstractNettyRequestHandler nettyRequestHandler;
-
- /**
- * Constructor. This starts new http server in the background and registers shutdown
hook for it.
- *
- * @param port server port
- * @param nettyRequestHandlerFactory request handler factory
- */
- NettyHttpServerImpl(final int port, final NettyRequestHandlerFactory<?>
nettyRequestHandlerFactory)
- {
- super();
- this.port = port;
- try
- {
- this.channelFactory = new
NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors
- .newCachedThreadPool());
-
- final ServerBootstrap bootstrap = new ServerBootstrap(this.channelFactory);
- this.nettyRequestHandler = nettyRequestHandlerFactory.newNettyRequestHandler();
- final WSServerPipelineFactory channelPipelineFactory = new
WSServerPipelineFactory();
- channelPipelineFactory.setRequestHandler(this.nettyRequestHandler);
- bootstrap.setPipelineFactory(channelPipelineFactory);
- bootstrap.setOption("child.tcpNoDelay", true);
- bootstrap.setOption("child.keepAlive", true);
- // Bind and start to accept incoming connections.
- final Channel c = bootstrap.bind(new InetSocketAddress(this.port));
- NettyHttpServerImpl.NETTY_CHANNEL_GROUP.add(c);
- // forking Netty server
- final Thread t = new Thread(this, "NettyHttpServer listening on port "
+ port);
- t.setDaemon(true);
- t.start();
- // registering shutdown hook
- final Runnable shutdownHook = new NettyHttpServerShutdownHook(this);
- Runtime.getRuntime().addShutdownHook(
- new Thread(shutdownHook, "NettyHttpServerShutdownHook(port=" +
port + ")"));
- }
- catch (Exception e)
- {
- throw new WebServiceException(e.getMessage(), e);
- }
- }
-
- /**
- * @see NettyHttpServer#registerCallback(NettyCallbackHandler)
- *
- * @param callback new callback
- */
- public void registerCallback(final NettyCallbackHandler callback)
- {
- if (callback != null)
- {
- this.ensureUpAndRunning();
- this.nettyRequestHandler.registerCallback(callback);
- }
- }
-
- /**
- * @see NettyHttpServer#unregisterCallback(NettyCallbackHandler)
- *
- * @param callback old callback
- */
- public void unregisterCallback(final NettyCallbackHandler callback)
- {
- if (callback != null)
- {
- this.ensureUpAndRunning();
- try
- {
- this.nettyRequestHandler.unregisterCallback(callback);
- }
- finally
- {
- if (!this.hasMoreCallbacks())
- {
- this.terminate();
- }
- }
- }
- }
-
- /**
- * @see NettyHttpServer#getCallback(String)
- *
- * @param requestPath request path
- * @return callback handler associated with path
- */
- public NettyCallbackHandler getCallback(final String requestPath)
- {
- if (requestPath == null)
- {
- throw new IllegalArgumentException("Null request path");
- }
-
- this.ensureUpAndRunning();
- return this.nettyRequestHandler.getCallback(requestPath);
- }
-
- /**
- * @see NettyHttpServer#hasMoreCallbacks()
- *
- * @return true if at least one callback handler is registered, false otherwise
- */
- public boolean hasMoreCallbacks()
- {
- this.ensureUpAndRunning();
- return this.nettyRequestHandler.hasMoreCallbacks();
- }
-
- /**
- * @see NettyHttpServer#getPort()
- *
- * @return server port
- */
- public int getPort()
- {
- this.ensureUpAndRunning();
- return this.port;
- }
-
- /**
- * Ensures server is up and running.
- */
- private synchronized void ensureUpAndRunning()
- {
- if (this.stopped)
- {
- throw new IllegalStateException("Server is down");
- }
- }
-
- /**
- * Handles incomming connections.
- */
- public synchronized void run()
- {
- while (!this.stopped)
- {
- try
- {
- this.wait(NettyHttpServerImpl.WAIT_PERIOD);
- }
- catch (InterruptedException ie)
- {
- ie.printStackTrace();
- }
- }
- try
- {
- //Close all connections and server sockets.
- NettyHttpServerImpl.NETTY_CHANNEL_GROUP.close().awaitUninterruptibly();
- //Shutdown the selector loop (boss and worker).
- if (this.channelFactory != null)
- {
- this.channelFactory.releaseExternalResources();
- }
- }
- finally
- {
- this.terminated = true;
- }
- }
-
- /**
- * Terminates server instance.
- */
- public synchronized void terminate()
- {
- if (this.stopped)
- {
- return;
- }
-
- this.stopped = true;
- while (!this.terminated)
- {
- try
- {
- this.wait(NettyHttpServerImpl.WAIT_PERIOD);
- }
- catch (InterruptedException ie)
- {
- ie.printStackTrace();
- }
- }
- synchronized (NettyHttpServerFactory.SERVERS)
- {
- NettyHttpServerFactory.SERVERS.remove(this.port);
- }
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,255 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.server.netty;
+
+import java.net.InetSocketAddress;
+import java.util.concurrent.Executors;
+
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.netty.bootstrap.ServerBootstrap;
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.channel.ChannelFactory;
+import org.jboss.netty.channel.group.ChannelGroup;
+import org.jboss.netty.channel.group.DefaultChannelGroup;
+import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
+import org.jboss.ws.core.client.transport.WSServerPipelineFactory;
+
+/**
+ * Netty http server implementation.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:asoldano@redhat.com">Alessio
Soldano</a>
+ */
+final class NettyHttpServerImpl implements NettyHttpServer, Runnable
+{
+
+ /** Wait period. */
+ private static final long WAIT_PERIOD = 100;
+
+ /** Netty channel group. */
+ static final ChannelGroup NETTY_CHANNEL_GROUP = new
DefaultChannelGroup("NettyHttpServer");
+
+ /** Server port. */
+ private final int port;
+
+ /** Indicates server is stopped. */
+ private boolean stopped;
+
+ /** Indicates server is terminated. */
+ private boolean terminated;
+
+ /** Channel factory. */
+ private ChannelFactory channelFactory;
+
+ /** Netty request handler. */
+ private AbstractNettyRequestHandler nettyRequestHandler;
+
+ /**
+ * Constructor. This starts new http server in the background and registers shutdown
hook for it.
+ *
+ * @param port server port
+ * @param nettyRequestHandlerFactory request handler factory
+ */
+ NettyHttpServerImpl(final int port, final NettyRequestHandlerFactory<?>
nettyRequestHandlerFactory)
+ {
+ super();
+ this.port = port;
+ try
+ {
+ this.channelFactory = new
NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors
+ .newCachedThreadPool());
+
+ final ServerBootstrap bootstrap = new ServerBootstrap(this.channelFactory);
+ this.nettyRequestHandler = nettyRequestHandlerFactory.newNettyRequestHandler();
+ final WSServerPipelineFactory channelPipelineFactory = new
WSServerPipelineFactory();
+ channelPipelineFactory.setRequestHandler(this.nettyRequestHandler);
+ bootstrap.setPipelineFactory(channelPipelineFactory);
+ bootstrap.setOption("child.tcpNoDelay", true);
+ bootstrap.setOption("child.keepAlive", true);
+ // Bind and start to accept incoming connections.
+ final Channel c = bootstrap.bind(new InetSocketAddress(this.port));
+ NettyHttpServerImpl.NETTY_CHANNEL_GROUP.add(c);
+ // forking Netty server
+ final Thread t = new Thread(this, "NettyHttpServer listening on port "
+ port);
+ t.setDaemon(true);
+ t.start();
+ // registering shutdown hook
+ final Runnable shutdownHook = new NettyHttpServerShutdownHook(this);
+ Runtime.getRuntime().addShutdownHook(
+ new Thread(shutdownHook, "NettyHttpServerShutdownHook(port=" +
port + ")"));
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * @see NettyHttpServer#registerCallback(NettyCallbackHandler)
+ *
+ * @param callback new callback
+ */
+ public void registerCallback(final NettyCallbackHandler callback)
+ {
+ if (callback != null)
+ {
+ this.ensureUpAndRunning();
+ this.nettyRequestHandler.registerCallback(callback);
+ }
+ }
+
+ /**
+ * @see NettyHttpServer#unregisterCallback(NettyCallbackHandler)
+ *
+ * @param callback old callback
+ */
+ public void unregisterCallback(final NettyCallbackHandler callback)
+ {
+ if (callback != null)
+ {
+ this.ensureUpAndRunning();
+ try
+ {
+ this.nettyRequestHandler.unregisterCallback(callback);
+ }
+ finally
+ {
+ if (!this.hasMoreCallbacks())
+ {
+ this.terminate();
+ }
+ }
+ }
+ }
+
+ /**
+ * @see NettyHttpServer#getCallback(String)
+ *
+ * @param requestPath request path
+ * @return callback handler associated with path
+ */
+ public NettyCallbackHandler getCallback(final String requestPath)
+ {
+ if (requestPath == null)
+ {
+ throw new IllegalArgumentException("Null request path");
+ }
+
+ this.ensureUpAndRunning();
+ return this.nettyRequestHandler.getCallback(requestPath);
+ }
+
+ /**
+ * @see NettyHttpServer#hasMoreCallbacks()
+ *
+ * @return true if at least one callback handler is registered, false otherwise
+ */
+ public boolean hasMoreCallbacks()
+ {
+ this.ensureUpAndRunning();
+ return this.nettyRequestHandler.hasMoreCallbacks();
+ }
+
+ /**
+ * @see NettyHttpServer#getPort()
+ *
+ * @return server port
+ */
+ public int getPort()
+ {
+ this.ensureUpAndRunning();
+ return this.port;
+ }
+
+ /**
+ * Ensures server is up and running.
+ */
+ private synchronized void ensureUpAndRunning()
+ {
+ if (this.stopped)
+ {
+ throw new IllegalStateException("Server is down");
+ }
+ }
+
+ /**
+ * Handles incomming connections.
+ */
+ public synchronized void run()
+ {
+ while (!this.stopped)
+ {
+ try
+ {
+ this.wait(NettyHttpServerImpl.WAIT_PERIOD);
+ }
+ catch (InterruptedException ie)
+ {
+ ie.printStackTrace();
+ }
+ }
+ try
+ {
+ //Close all connections and server sockets.
+ NettyHttpServerImpl.NETTY_CHANNEL_GROUP.close().awaitUninterruptibly();
+ //Shutdown the selector loop (boss and worker).
+ if (this.channelFactory != null)
+ {
+ this.channelFactory.releaseExternalResources();
+ }
+ }
+ finally
+ {
+ this.terminated = true;
+ }
+ }
+
+ /**
+ * Terminates server instance.
+ */
+ public synchronized void terminate()
+ {
+ if (this.stopped)
+ {
+ return;
+ }
+
+ this.stopped = true;
+ while (!this.terminated)
+ {
+ try
+ {
+ this.wait(NettyHttpServerImpl.WAIT_PERIOD);
+ }
+ catch (InterruptedException ie)
+ {
+ ie.printStackTrace();
+ }
+ }
+ synchronized (NettyHttpServerFactory.SERVERS)
+ {
+ NettyHttpServerFactory.SERVERS.remove(this.port);
+ }
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,34 +0,0 @@
-package org.jboss.ws.core.server.netty;
-
-/**
- * Netty server shutdown hook.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class NettyHttpServerShutdownHook implements Runnable
-{
-
- /** Delegee. */
- private final NettyHttpServerImpl server;
-
- /**
- * Constructor.
- *
- * @param server netty http server
- */
- NettyHttpServerShutdownHook(final NettyHttpServerImpl server)
- {
- super();
-
- this.server = server;
- }
-
- /**
- * Terminates server.
- */
- public void run()
- {
- this.server.terminate();
- }
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyHttpServerShutdownHook.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,34 @@
+package org.jboss.ws.core.server.netty;
+
+/**
+ * Netty server shutdown hook.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class NettyHttpServerShutdownHook implements Runnable
+{
+
+ /** Delegee. */
+ private final NettyHttpServerImpl server;
+
+ /**
+ * Constructor.
+ *
+ * @param server netty http server
+ */
+ NettyHttpServerShutdownHook(final NettyHttpServerImpl server)
+ {
+ super();
+
+ this.server = server;
+ }
+
+ /**
+ * Terminates server.
+ */
+ public void run()
+ {
+ this.server.terminate();
+ }
+
+}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java
===================================================================
---
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server.netty;
-
-/**
- * Netty request handler factory.
- *
- * @param <T> netty request handler type
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public interface NettyRequestHandlerFactory<T extends AbstractNettyRequestHandler>
-{
-
- /**
- * Creates new Netty request handler instance.
- * @return handler instance
- */
- T newNettyRequestHandler();
-
-}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/netty/NettyRequestHandlerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.server.netty;
+
+/**
+ * Netty request handler factory.
+ *
+ * @param <T> netty request handler type
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public interface NettyRequestHandlerFactory<T extends AbstractNettyRequestHandler>
+{
+
+ /**
+ * Creates new Netty request handler instance.
+ * @return handler instance
+ */
+ T newNettyRequestHandler();
+
+}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -21,9 +21,10 @@
*/
package org.jboss.ws.extensions.eventing.mgmt;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.wsf.spi.util.KernelLocator;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
/**
* Subscription manager factory impl
@@ -43,11 +44,17 @@
return instance;
}
+ /**
+ * Returns subscription manager registered in MC kernel.
+ *
+ * @return subscription manager
+ */
public SubscriptionManagerMBean getSubscriptionManager()
{
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
- KernelController controller = KernelLocator.getKernel().getController();
- ControllerContext ctx =
controller.getInstalledContext(SubscriptionManagerMBean.BEAN_NAME);
- return (SubscriptionManagerMBean)ctx.getTarget();
+ return iocContainer.getBean(SubscriptionManagerMBean.BEAN_NAME,
SubscriptionManagerMBean.class);
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,220 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.transport.backchannel;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.jboss.logging.Logger;
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.buffer.ChannelBufferInputStream;
-import org.jboss.netty.channel.ChannelFuture;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ChannelPipelineCoverage;
-import org.jboss.netty.channel.ChannelStateEvent;
-import org.jboss.netty.channel.ExceptionEvent;
-import org.jboss.netty.channel.MessageEvent;
-import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
-import org.jboss.netty.handler.codec.http.Cookie;
-import org.jboss.netty.handler.codec.http.CookieDecoder;
-import org.jboss.netty.handler.codec.http.CookieEncoder;
-import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
-import org.jboss.netty.handler.codec.http.HttpHeaders;
-import org.jboss.netty.handler.codec.http.HttpRequest;
-import org.jboss.netty.handler.codec.http.HttpResponse;
-import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import org.jboss.netty.handler.codec.http.HttpVersion;
-import org.jboss.ws.extensions.wsrm.transport.RMMessage;
-import org.jboss.ws.extensions.wsrm.transport.RMUnMarshaller;
-
-/**
- * TODO: Add comment
- *
- * @author richard.opalka(a)jboss.com
- * @author alessio.soldano(a)jboss.com
- *
- * @since Nov 20, 2007
- */
-@ChannelPipelineCoverage("one")
-public final class RMBackPortsInvocationHandler extends SimpleChannelUpstreamHandler
-{
- private static final Logger LOG =
Logger.getLogger(RMBackPortsInvocationHandler.class);
- private final List<RMCallbackHandler> callbacks = new
LinkedList<RMCallbackHandler>();
- private final Lock lock = new ReentrantLock();
-
-
- public RMBackPortsInvocationHandler()
- {
- }
-
- @Override
- public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
- {
- // HERE: Add all accepted channels to the group
- // so that they are closed properly on shutdown
- // If the added channel is closed before shutdown,
- // it will be removed from the group automatically.
- RMBackPortsServer.channelGroup.add(ctx.getChannel());
- }
-
- @Override
- public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws
Exception
- {
- HttpRequest request = (HttpRequest)e.getMessage();
- ChannelBuffer content = request.getContent();
-
- Map<String, Object> requestHeaders = new HashMap<String, Object>();
- for (String headerName : request.getHeaderNames())
- {
- requestHeaders.put(headerName, request.getHeaders(headerName));
- }
- boolean error = false;
- try
- {
- String requestPath = new URL(request.getUri()).getPath();
- RMMessage message =
(RMMessage)RMUnMarshaller.getInstance().read(content.readable() ? new
ChannelBufferInputStream(content) : null, requestHeaders);
- handle(requestPath, message);
- }
- catch (Throwable t)
- {
- error = true;
- LOG.error("Error decoding request to the backport", t);
- }
- finally
- {
- writeResponse(e, request, error);
- }
- }
-
-
- private void handle(String requestPath, RMMessage message)
- {
- this.lock.lock();
- try
- {
- boolean handlerExists = false;
- for (RMCallbackHandler handler : this.callbacks)
- {
- if (handler.getHandledPath().equals(requestPath))
- {
- handlerExists = true;
- if (LOG.isDebugEnabled())
- LOG.debug("Handling request path: " + requestPath);
- handler.handle(message);
- break;
- }
- }
- if (handlerExists == false)
- LOG.warn("No callback handler registered for path: " +
requestPath);
- }
- finally
- {
- this.lock.unlock();
- }
- }
-
- private void writeResponse(MessageEvent e, HttpRequest request, boolean error)
- {
- // Build the response object.
- HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, error ?
HttpResponseStatus.INTERNAL_SERVER_ERROR : HttpResponseStatus.NO_CONTENT);
- response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/plain;
charset=UTF-8");
-
- String cookieString = request.getHeader(HttpHeaders.Names.COOKIE);
- if (cookieString != null)
- {
- CookieDecoder cookieDecoder = new CookieDecoder();
- Set<Cookie> cookies = cookieDecoder.decode(cookieString);
- if (!cookies.isEmpty())
- {
- // Reset the cookies if necessary.
- CookieEncoder cookieEncoder = new CookieEncoder(true);
- for (Cookie cookie : cookies)
- {
- cookieEncoder.addCookie(cookie);
- }
- response.addHeader(HttpHeaders.Names.SET_COOKIE, cookieEncoder.encode());
- }
- }
-
- // Write the response.
- ChannelFuture cf = e.getChannel().write(response);
- cf.awaitUninterruptibly();
- }
-
- @Override
- public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws
Exception
- {
- e.getCause().printStackTrace();
- e.getChannel().close();
- }
-
- public RMCallbackHandler getCallback(String requestPath)
- {
- this.lock.lock();
- try
- {
- for (RMCallbackHandler handler : this.callbacks)
- {
- if (handler.getHandledPath().equals(requestPath))
- return handler;
- }
- }
- finally
- {
- this.lock.unlock();
- }
-
- return null;
- }
-
- public void registerCallback(RMCallbackHandler callbackHandler)
- {
- this.lock.lock();
- try
- {
- this.callbacks.add(callbackHandler);
- }
- finally
- {
- this.lock.unlock();
- }
- }
-
- public void unregisterCallback(RMCallbackHandler callbackHandler)
- {
- this.lock.lock();
- try
- {
- this.callbacks.remove(callbackHandler);
- }
- finally
- {
- this.lock.unlock();
- }
- }
-}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsServer.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,233 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.extensions.wsrm.transport.backchannel;
-
-import java.net.InetSocketAddress;
-import java.util.concurrent.Executors;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.jboss.logging.Logger;
-import org.jboss.netty.bootstrap.ServerBootstrap;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelFactory;
-import org.jboss.netty.channel.group.ChannelGroup;
-import org.jboss.netty.channel.group.DefaultChannelGroup;
-import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
-import org.jboss.ws.core.client.transport.WSServerPipelineFactory;
-import org.jboss.ws.extensions.wsrm.api.RMException;
-
-/**
- * Back ports server used by addressable clients
- *
- * @author richard.opalka(a)jboss.com
- * @author alessio.soldano(a)jboss.com
- *
- * @since Nov 20, 2007
- */
-public final class RMBackPortsServer implements Runnable
-{
- private static final Logger LOG = Logger.getLogger(RMBackPortsServer.class);
- private static final Lock CLASS_LOCK = new ReentrantLock();
- private static final long WAIT_PERIOD = 100;
- private static RMBackPortsServer INSTANCE;
- static final ChannelGroup channelGroup = new
DefaultChannelGroup("rmBackPortsServer");
-
- private final Object instanceLock = new Object();
- private final String scheme;
- private final String host;
- private final int port;
- private RMBackPortsInvocationHandler handler;
- private boolean started;
- private boolean stopped;
- private boolean terminated;
- private ChannelFactory factory;
-
- public final void registerCallback(RMCallbackHandler callbackHandler)
- {
- this.handler.registerCallback(callbackHandler);
- }
-
- public final void unregisterCallback(RMCallbackHandler callbackHandler)
- {
- this.handler.unregisterCallback(callbackHandler);
- }
-
- public final RMCallbackHandler getCallback(String requestPath)
- {
- return this.handler.getCallback(requestPath);
- }
-
- private RMBackPortsServer(String scheme, String host, int port) throws RMException
- {
- super();
- this.scheme = scheme;
- this.host = host;
- this.port = port;
- try
- {
- factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
-
- ServerBootstrap bootstrap = new ServerBootstrap(factory);
- this.handler = new RMBackPortsInvocationHandler();
- WSServerPipelineFactory channelPipelineFactory = new WSServerPipelineFactory();
- channelPipelineFactory.setRequestHandler(this.handler);
- bootstrap.setPipelineFactory(channelPipelineFactory);
- bootstrap.setOption("child.tcpNoDelay", true);
- bootstrap.setOption("child.keepAlive", true);
- // Bind and start to accept incoming connections.
- Channel c = bootstrap.bind(new InetSocketAddress(this.port));
- channelGroup.add(c);
- if (LOG.isDebugEnabled())
- LOG.debug("WS-RM Backports Server started on port: " + this.port);
- }
- catch (Exception e)
- {
- LOG.warn(e.getMessage(), e);
- throw new RMException(e.getMessage(), e);
- }
- }
-
- public final String getScheme()
- {
- return this.scheme;
- }
-
- public final String getHost()
- {
- return this.host;
- }
-
- public final int getPort()
- {
- return this.port;
- }
-
- public final void run()
- {
- synchronized (this.instanceLock)
- {
- if (this.started)
- return;
-
- this.started = true;
-
- while (this.stopped == false)
- {
- try
- {
- this.instanceLock.wait(WAIT_PERIOD);
- LOG.debug("serving requests");
- }
- catch (InterruptedException ie)
- {
- LOG.warn(ie.getMessage(), ie);
- }
- }
- try
- {
- //Close all connections and server sockets.
- channelGroup.close().awaitUninterruptibly();
- //Shutdown the selector loop (boss and worker).
- if (factory != null)
- {
- factory.releaseExternalResources();
- }
- }
- finally
- {
- LOG.debug("terminated");
- this.terminated = true;
- }
- }
- }
-
- public final void terminate()
- {
- synchronized (this.instanceLock)
- {
- if (this.stopped == true)
- return;
-
- this.stopped = true;
- LOG.debug("termination forced");
- while (this.terminated == false)
- {
- try
- {
- LOG.debug("waiting for termination");
- this.instanceLock.wait(WAIT_PERIOD);
- }
- catch (InterruptedException ie)
- {
- LOG.warn(ie.getMessage(), ie);
- }
- }
- }
- }
-
- /**
- * Starts back ports server on the background if method is called for the first time
- * @param scheme protocol
- * @param host hostname
- * @param port port
- * @return WS-RM back ports server
- * @throws RMException
- */
- public static RMBackPortsServer getInstance(String scheme, String host, int port)
throws RMException
- {
- CLASS_LOCK.lock();
- try
- {
- if (INSTANCE == null)
- {
- INSTANCE = new RMBackPortsServer(scheme, host, (port == -1) ? 80 : port);
- // forking back ports server
- Thread t = new Thread(INSTANCE, "RMBackPortsServer");
- t.setDaemon(true);
- t.start();
- // registering shutdown hook
- final RMBackPortsServer server = INSTANCE;
- Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
- public void run()
- {
- server.terminate();
- }
- }, "RMBackPortsServerShutdownHook"));
- }
- else
- {
- boolean schemeEquals = INSTANCE.getScheme().equals(scheme);
- boolean hostEquals = INSTANCE.getHost().equals(host);
- boolean portEquals = INSTANCE.getPort() == ((port == -1) ? 80 : port);
- if ((schemeEquals == false) || (hostEquals == false) || (portEquals ==
false))
- throw new IllegalArgumentException();
- }
- return INSTANCE;
- }
- finally
- {
- CLASS_LOCK.unlock();
- }
- }
-
-}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandler.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.transport.backchannel;
+import org.jboss.ws.core.server.netty.NettyCallbackHandler;
import org.jboss.ws.extensions.wsrm.transport.RMMessage;
import org.jboss.ws.extensions.wsrm.transport.RMUnassignedMessageListener;
@@ -31,9 +32,8 @@
*
* @since Nov 21, 2007
*/
-public interface RMCallbackHandler
+public interface RMCallbackHandler extends NettyCallbackHandler
{
- String getHandledPath();
void handle(RMMessage message);
RMMessage getMessage(String messageId);
Throwable getFault(String messageId);
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -25,6 +25,9 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+import org.jboss.ws.core.server.netty.NettyHttpServer;
+import org.jboss.ws.core.server.netty.NettyHttpServerFactory;
+
/**
* Callback factory
*
@@ -34,7 +37,7 @@
*/
public final class RMCallbackHandlerFactory
{
- private static RMBackPortsServer server;
+ private static NettyHttpServer server;
private static Lock lock = new ReentrantLock();
private RMCallbackHandlerFactory()
@@ -49,9 +52,9 @@
{
if (server == null)
{
- server = RMBackPortsServer.getInstance(backPort.getScheme(),
backPort.getHost(), backPort.getPort());
+ server = NettyHttpServerFactory.getNettyHttpServer(backPort.getPort(),
RMRequestHandlerFactory.getInstance());
}
- RMCallbackHandler callbackHandler = server.getCallback(backPort.getPath());
+ RMCallbackHandler callbackHandler =
(RMCallbackHandler)server.getCallback(backPort.getPath());
if (callbackHandler == null)
{
callbackHandler = new RMCallbackHandlerImpl(backPort.getPath());
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMCallbackHandlerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -59,13 +59,23 @@
logger.debug("Registered callback handler listening on '" +
handledPath + "' request path");
}
+ public void init()
+ {
+ // does nothing
+ }
+
+ public void destroy()
+ {
+ // does nothing
+ }
+
public Throwable getFault(String messageId)
{
// TODO implement
return null;
}
- public final String getHandledPath()
+ public final String getPath()
{
return this.handledPath;
}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerFactory.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerFactory.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerFactory.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerFactory.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport.backchannel;
+
+import org.jboss.ws.core.server.netty.NettyRequestHandlerFactory;
+
+/**
+ * TODO: javadoc
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class RMRequestHandlerFactory implements
NettyRequestHandlerFactory<RMRequestHandlerImpl>
+{
+ private static final NettyRequestHandlerFactory<RMRequestHandlerImpl> SINGLETON
= new RMRequestHandlerFactory();
+
+ public RMRequestHandlerImpl newNettyRequestHandler()
+ {
+ return new RMRequestHandlerImpl();
+ }
+
+ public static NettyRequestHandlerFactory<RMRequestHandlerImpl> getInstance()
+ {
+ return SINGLETON;
+ }
+}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java
(from rev 10915,
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.wsrm.transport.backchannel;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBufferInputStream;
+import org.jboss.netty.channel.ChannelFuture;
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.MessageEvent;
+import org.jboss.netty.handler.codec.http.Cookie;
+import org.jboss.netty.handler.codec.http.CookieDecoder;
+import org.jboss.netty.handler.codec.http.CookieEncoder;
+import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
+import org.jboss.netty.handler.codec.http.HttpRequest;
+import org.jboss.netty.handler.codec.http.HttpResponse;
+import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import org.jboss.netty.handler.codec.http.HttpVersion;
+import org.jboss.ws.core.server.netty.AbstractNettyRequestHandler;
+import org.jboss.ws.extensions.wsrm.transport.RMMessage;
+import org.jboss.ws.extensions.wsrm.transport.RMUnMarshaller;
+
+/**
+ * RM backports server request handler.
+ *
+ * @author richard.opalka(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
+ */
+public final class RMRequestHandlerImpl extends AbstractNettyRequestHandler
+{
+ private static final Logger LOG = Logger.getLogger(RMRequestHandlerImpl.class);
+
+ /**
+ * Constructor.
+ */
+ public RMRequestHandlerImpl()
+ {
+ super();
+ }
+
+ @Override
+ public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws
Exception
+ {
+ HttpRequest request = (HttpRequest)e.getMessage();
+ ChannelBuffer content = request.getContent();
+
+ Map<String, Object> requestHeaders = new HashMap<String, Object>();
+ for (String headerName : request.getHeaderNames())
+ {
+ requestHeaders.put(headerName, request.getHeaders(headerName));
+ }
+ boolean error = false;
+ try
+ {
+ String requestPath = new URL(request.getUri()).getPath();
+ RMMessage message =
(RMMessage)RMUnMarshaller.getInstance().read(content.readable() ? new
ChannelBufferInputStream(content) : null, requestHeaders);
+ handle(requestPath, message);
+ }
+ catch (Throwable t)
+ {
+ error = true;
+ LOG.error("Error decoding request to the backport", t);
+ }
+ finally
+ {
+ writeResponse(e, request, error);
+ }
+ }
+
+
+ private void handle(String requestPath, RMMessage message)
+ {
+ RMCallbackHandler handler = (RMCallbackHandler)this.getCallback(requestPath);
+ if (handler != null)
+ {
+ handler.handle(message);
+ }
+ else
+ {
+ LOG.warn("No callback handler registered for path: " + requestPath);
+ }
+ }
+
+ private void writeResponse(MessageEvent e, HttpRequest request, boolean error)
+ {
+ // Build the response object.
+ HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, error ?
HttpResponseStatus.INTERNAL_SERVER_ERROR : HttpResponseStatus.NO_CONTENT);
+ response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/plain;
charset=UTF-8");
+
+ String cookieString = request.getHeader(HttpHeaders.Names.COOKIE);
+ if (cookieString != null)
+ {
+ CookieDecoder cookieDecoder = new CookieDecoder();
+ Set<Cookie> cookies = cookieDecoder.decode(cookieString);
+ if (!cookies.isEmpty())
+ {
+ // Reset the cookies if necessary.
+ CookieEncoder cookieEncoder = new CookieEncoder(true);
+ for (Cookie cookie : cookies)
+ {
+ cookieEncoder.addCookie(cookie);
+ }
+ response.addHeader(HttpHeaders.Names.SET_COOKIE, cookieEncoder.encode());
+ }
+ }
+
+ // Write the response.
+ ChannelFuture cf = e.getChannel().write(response);
+ cf.awaitUninterruptibly();
+ }
+
+}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -146,6 +146,13 @@
urlPattern = endpoint.getURLPattern();
}
+ // Endpoint API hack
+ Integer port = (Integer)dep.getService().getProperty("port");
+ if (port == null)
+ {
+ port = -1;
+ }
+
// If not, derive the context root from the deployment
if (contextRoot == null)
{
@@ -175,7 +182,7 @@
sepMetaData.setURLPattern(urlPattern);
String servicePath = contextRoot + urlPattern;
- sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath));
+ sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath,
port));
}
public static ObjectName createServiceEndpointID(Deployment dep,
ServerEndpointMetaData sepMetaData)
@@ -214,7 +221,7 @@
/** Get the web service address for a given path
*/
- public static String getServiceEndpointAddress(String uriScheme, String servicePath)
+ public static String getServiceEndpointAddress(String uriScheme, String servicePath,
int servicePort)
{
if (servicePath == null || servicePath.length() == 0)
throw new WSException("Service path cannot be null");
@@ -230,22 +237,29 @@
String host = config.getWebServiceHost();
String port = "";
- if ("https".equals(uriScheme))
+ if (servicePort != -1)
{
- int portNo = config.getWebServiceSecurePort();
- if (portNo != 443)
- {
- port = ":" + portNo;
- }
-
+ port = ":" + servicePort;
}
else
{
- int portNo = config.getWebServicePort();
- if (portNo != 80)
+ if ("https".equals(uriScheme))
{
- port = ":" + portNo;
+ int portNo = config.getWebServiceSecurePort();
+ if (portNo != 443)
+ {
+ port = ":" + portNo;
+ }
+
}
+ else
+ {
+ int portNo = config.getWebServicePort();
+ if (portNo != 80)
+ {
+ port = ":" + portNo;
+ }
+ }
}
String urlStr = uriScheme + "://" + host + port + servicePath;
@@ -322,7 +336,7 @@
if (requiresRewrite(orgAddress, uriScheme))
{
String servicePath = sepMetaData.getContextRoot() +
sepMetaData.getURLPattern();
- String serviceEndpointURL = getServiceEndpointAddress(uriScheme,
servicePath);
+ String serviceEndpointURL = getServiceEndpointAddress(uriScheme,
servicePath, -1);
if (log.isDebugEnabled())
log.debug("Replace service endpoint address '" +
orgAddress + "' with '" + serviceEndpointURL + "'");
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointRegistryFactoryImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointRegistryFactoryImpl.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointRegistryFactoryImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.stack.jbws;
-
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.common.KernelAwareSPIFactory;
-
-/**
- * An EndpointRegistryFactory implementation that retrieves
- * the registry from MC kernel.
- *
- * @see EndpointRegistry.BEAN_NAME
- *
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 23, 2007
- */
-public class EndpointRegistryFactoryImpl extends EndpointRegistryFactory
-{
- public EndpointRegistry getEndpointRegistry()
- {
- return new KernelAwareSPIFactory().getKernelProvidedSPI(
- EndpointRegistry.BEAN_NAME, EndpointRegistry.class
- );
- }
-}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -51,6 +51,8 @@
import javax.xml.ws.http.HTTPBinding;
import org.jboss.logging.Logger;
+import org.jboss.netty.handler.codec.http.HttpMessage;
+import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonBinding;
@@ -65,6 +67,7 @@
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.jaxws.spi.http.AbstractNettyMessage;
import org.jboss.ws.core.server.MimeHeaderSource;
import org.jboss.ws.core.server.ServiceEndpointInvoker;
import org.jboss.ws.core.server.ServletHeaderSource;
@@ -260,6 +263,7 @@
// Set servlet specific properties
HttpServletResponse httpResponse = null;
ServletHeaderSource headerSource = null;
+ AbstractNettyMessage nettyMessage = this.getNettyHeadersSource(invContext);
if (invContext instanceof ServletRequestContext)
{
ServletRequestContext reqContext = (ServletRequestContext)invContext;
@@ -293,18 +297,32 @@
try
{
msgContext.setEndpointMetaData(sepMetaData);
- MessageAbstraction resMessage = processRequest(endpoint, headerSource,
invContext, inStream);
+ MessageAbstraction resMessage = processRequest(endpoint, nettyMessage == null ?
headerSource : nettyMessage, invContext, inStream);
// Replace the message context with the response context
msgContext = MessageContextAssociation.peekMessageContext();
Map<String, List<String>> headers = (Map<String,
List<String>>)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
- if (headerSource != null && headers != null)
- headerSource.setHeaderMap(headers);
+ if (headers != null)
+ {
+ if (headerSource != null)
+ {
+ headerSource.setHeaderMap(headers);
+ }
+ }
Integer code = (Integer)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_CODE);
- if (httpResponse != null && code != null)
- httpResponse.setStatus(code.intValue());
+ if (code != null)
+ {
+ if (httpResponse != null)
+ {
+ httpResponse.setStatus(code.intValue());
+ }
+ else if (nettyMessage != null)
+ {
+ nettyMessage.setStatus(code.intValue());
+ }
+ }
boolean isFault = false;
if (resMessage instanceof SOAPMessage)
@@ -320,9 +338,16 @@
// by a null envelope.
SOAPEnvelope soapEnv = part.getEnvelope();
isFault = soapEnv != null && soapEnv.getBody().hasFault();
- if (httpResponse != null && isFault)
+ if (isFault)
{
- httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ if (httpResponse != null)
+ {
+ httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
+ else if (nettyMessage != null)
+ {
+ nettyMessage.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
}
}
@@ -349,6 +374,11 @@
}
}
+ private AbstractNettyMessage getNettyHeadersSource(final InvocationContext
invContext)
+ {
+ return (AbstractNettyMessage)invContext.getProperty(Constants.NETTY_MESSAGE);
+ }
+
private void sendResponse(Endpoint endpoint, OutputStream output, boolean isFault)
throws SOAPException, IOException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
@@ -582,17 +612,19 @@
try
{
- if (context instanceof ServletRequestContext)
+ if (this.validInvocationContext(context))
{
- handleWSDLRequestFromServletContext(endpoint, outStream, context);
+ final String resourcePath = this.getResourcePath(context);
+ final URL requestURL = this.getRequestURL(endpoint, context);
+ this.handleWSDLRequest(endpoint, outStream, resourcePath, requestURL);
}
else
{
- String epAddress = endpoint.getAddress();
+ final String epAddress = endpoint.getAddress();
if (epAddress == null)
throw new IllegalArgumentException("Invalid endpoint address: "
+ epAddress);
- URL wsdlUrl = new URL(epAddress + "?wsdl");
+ final URL wsdlUrl = new URL(epAddress + "?wsdl");
IOUtils.copyStream(outStream, wsdlUrl.openStream());
}
}
@@ -606,19 +638,60 @@
}
}
- private void handleWSDLRequestFromServletContext(Endpoint endpoint, OutputStream
outputStream, InvocationContext context) throws MalformedURLException, IOException
+ private URL getRequestURL(Endpoint endpoint, InvocationContext context) throws
MalformedURLException
{
+ URL requestURL = null;
+
+ if (context instanceof ServletRequestContext)
+ {
+ ServletRequestContext reqContext = (ServletRequestContext)context;
+ HttpServletRequest req = reqContext.getHttpServletRequest();
+ requestURL = new URL(req.getRequestURL().toString());
+ }
+ else if (context.getProperty(Constants.NETTY_MESSAGE) != null)
+ {
+ requestURL = new URL(endpoint.getAddress());
+ }
+
+ return requestURL;
+ }
+
+ private String getResourcePath(final InvocationContext context)
+ {
+ String resourcePath = null;
+
+ if (context instanceof ServletRequestContext)
+ {
+ ServletRequestContext reqContext = (ServletRequestContext)context;
+ HttpServletRequest req = reqContext.getHttpServletRequest();
+ resourcePath = (String)req.getParameter("resource");
+ }
+ else if (context.getProperty(Constants.NETTY_MESSAGE) != null)
+ {
+ return null;
+ // TODO: implement resourcePath = getResourcePath(nettyMessage.getUri()); //
i.e. parse it from query string
+ }
+
+ return resourcePath;
+ }
+
+ private boolean validInvocationContext(InvocationContext context)
+ {
+ if (context == null)
+ return false;
+
+ final boolean servletInvocationContext = context instanceof ServletRequestContext;
+ final boolean nettyInvocationContext = context.getProperty(Constants.NETTY_MESSAGE)
!= null;
+
+ return servletInvocationContext || nettyInvocationContext;
+ }
+
+ private void handleWSDLRequest(Endpoint endpoint, OutputStream outputStream, String
resPath, URL reqURL) throws MalformedURLException, IOException
+ {
ServerEndpointMetaData epMetaData =
endpoint.getAttachment(ServerEndpointMetaData.class);
if (epMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
- ServletRequestContext reqContext = (ServletRequestContext)context;
- HttpServletRequest req = reqContext.getHttpServletRequest();
-
- // For the base document the resourcePath should be null
- String resPath = (String)req.getParameter("resource");
- URL reqURL = new URL(req.getRequestURL().toString());
-
String wsdlHost = reqURL.getHost();
if (ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()) ==
false)
Deleted:
stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
===================================================================
---
stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1 +0,0 @@
-org.jboss.wsf.stack.jbws.EndpointRegistryFactoryImpl
\ No newline at end of file
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/AddressingTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/AddressingTestCase.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsa/AddressingTestCase.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -35,7 +35,6 @@
import javax.xml.ws.addressing.*;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.soap.SOAPFaultException;
-import java.io.File;
import java.net.URI;
import java.net.URL;
import java.util.List;
@@ -90,12 +89,12 @@
((BindingProvider)echoPort).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://"+getServerHost()+":8080/wsa10/echo"
+ "http://"+getInteropServerHost()+":8080/wsa10/echo"
);
((BindingProvider)notifyPort).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://"+getServerHost()+":8080/wsa10/notify"
+ "http://"+getInteropServerHost()+":8080/wsa10/notify"
);
configureClient();
@@ -112,11 +111,11 @@
private void configureClient() {
((BindingProvider)echoPort).getRequestContext().put(
- BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://"+getServerHost()+":8080/wsa10/echo"
+ BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://"+getInteropServerHost()+":8080/wsa10/echo"
);
((BindingProvider)notifyPort).getRequestContext().put(
- BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://"+getServerHost()+":8080/wsa10/notify"
+ BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://"+getInteropServerHost()+":8080/wsa10/notify"
);
/*
@@ -146,7 +145,7 @@
}
- public String getServerHost()
+ private String getInteropServerHost()
{
String host = null;
if("true".equals( System.getProperty("interop") ) )
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -39,23 +39,20 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.http.HttpContext;
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.http.HttpServerFactory;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
/**
- * Test Endpoint deployment
+ * Tests Endpoint deployment in J2EE environment.
*
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Jul-2006
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class EndpointServlet extends HttpServlet
{
- private Endpoint endpoint;
+
+ private Endpoint endpoint1;
+ private Endpoint endpoint2;
private static final String TEST_ELEMENT = "<fabrikam:CustomerKey
xmlns:fabrikam='http://example.com/fabrikam'>123456789</fab...;
@Override
@@ -63,25 +60,16 @@
{
super.init(config);
- // Create the endpoint
- EndpointBean epImpl = new EndpointBean();
- endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl);
-
- // Create and start the HTTP server
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- HttpServer httpServer =
spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
- httpServer.start();
-
- // Create the context and publish the endpoint
- HttpContext context = httpServer.createContext("/jaxws-endpoint");
- endpoint.publish(context);
+ endpoint1 = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, new EndpointBean());
+ endpoint1.publish("http://localhost:8080/jaxws-endpoint");
+ endpoint2 =
Endpoint.publish("http://localhost:8080/jaxws-endpoint2/endpoint/long/path",
EndpointBean.class);
}
@Override
public void destroy()
{
- // Stop the endpoint
- endpoint.stop();
+ endpoint1.stop();
+ endpoint2.stop();
super.destroy();
}
@@ -99,16 +87,15 @@
String retStr = port.echo(param);
//Test epr
-
assertEndpointReference(endpoint.getEndpointReference(DOMUtils.parse(TEST_ELEMENT)),
TEST_ELEMENT);
- assertEndpointReference(endpoint.getEndpointReference(W3CEndpointReference.class,
(Element[])null), null);
+
assertEndpointReference(endpoint1.getEndpointReference(DOMUtils.parse(TEST_ELEMENT)),
TEST_ELEMENT);
+ assertEndpointReference(endpoint1.getEndpointReference(W3CEndpointReference.class,
(Element[])null), null);
// Return the result
PrintWriter pw = new PrintWriter(res.getWriter());
pw.print(retStr);
+ pw.close();
}
-
-
private void assertEndpointReference(EndpointReference epr, String refPar) throws
IOException
{
Logger.getLogger(this.getClass()).info("epr: "+epr);
@@ -121,7 +108,6 @@
assert("http://127.0.0.1:8080/jaxws-endpoint".equals(addresses.item(0).getFirstChild().getNodeValue()));
if (refPar != null)
{
- //TODO enhance this check
assert(epr.toString().contains(refPar));
}
}
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2009-10-15
23:02:53 UTC (rev 10921)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -22,13 +22,9 @@
package org.jboss.test.ws.jaxws.endpoint;
import java.io.BufferedReader;
-import java.io.File;
import java.io.InputStreamReader;
import java.net.URL;
-import javax.management.Attribute;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
import javax.wsdl.Definition;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
@@ -39,7 +35,6 @@
import junit.framework.Test;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -50,37 +45,18 @@
*/
public class EndpointTestCase extends JBossWSTest
{
+
public static Test suite()
{
- return new TestSetup(new JBossWSTestSetup(EndpointTestCase.class,
"jaxws-endpoint-servlet.war")) {
-
- private Boolean useJBossWebLoader;
-
- protected void setUp() throws Exception
- {
- MBeanServerConnection server = JBossWSTestHelper.getServer();
- useJBossWebLoader = (Boolean)server.getAttribute(new
ObjectName("jboss.web:service=WebServer"), "UseJBossWebLoader");
- server.setAttribute(new ObjectName("jboss.web:service=WebServer"),
new Attribute("UseJBossWebLoader", Boolean.TRUE));
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- MBeanServerConnection server = JBossWSTestHelper.getServer();
- server.setAttribute(new ObjectName("jboss.web:service=WebServer"),
new Attribute("UseJBossWebLoader", useJBossWebLoader));
- }
- };
+ return new TestSetup(new JBossWSTestSetup(EndpointTestCase.class,
"jaxws-endpoint-servlet.war"));
}
public void testWSDLAccess() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-endpoint?wsdl");
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
- assertNotNull(wsdlDefinition);
+ readWSDL(new URL("http://" + getServerHost() +
":8080/jaxws-endpoint?wsdl"));
+ readWSDL(new URL("http://" + getServerHost() +
":8080/jaxws-endpoint2/endpoint/long/path?wsdl"));
}
-
+
public void testClientAccess() throws Exception
{
// Create the port
@@ -100,4 +76,12 @@
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("hello-world", br.readLine());
}
+
+ private void readWSDL(URL wsdlURL) throws Exception
+ {
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
+ assertNotNull(wsdlDefinition);
+ }
+
}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse
(from rev 10915,
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse)
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
===================================================================
---
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,244 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.endpoint.jse;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.soap.MTOMFeature;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHRequest;
-import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHResponse;
-import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Iface;
-import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Impl;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * Tests endpoint dynamic publishing in JSE environment.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class UsecasesTestCase extends JBossWSTest
-{
- private static WebServiceFeature[] mtomEnabled = new WebServiceFeature[] { new
MTOMFeature(true) };
-
- private static int port1 = 8871;
- private static int port2 = 8872;
-
- public void testDifferentPortsSameContext() throws Exception
- {
- String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/";
- Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
-
- String publishURL2 = "http://" + getServerHost() + ":" + port2
+ "/jaxws-endpoint";
- Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
-
- invokeEndpoint1(publishURL1);
- invokeEndpoint1(publishURL2);
-
- endpoint1.stop();
- endpoint2.stop();
- }
-
- public void testDifferentPortsNoContext() throws Exception
- {
- String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/";
- Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
-
- String publishURL2 = "http://" + getServerHost() + ":" +
port2;
- Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
-
- invokeEndpoint1(publishURL1);
- invokeEndpoint1(publishURL2);
-
- endpoint1.stop();
- endpoint2.stop();
- }
-
- public void testDifferentPortsAndLongPaths() throws Exception
- {
- String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/long/path/";
- Endpoint endpoint1 = publishEndpoint3(Endpoint1Impl.class, publishURL1);
-
- String publishURL2 = "http://" + getServerHost() + ":" + port2
+ "/jaxws-endpoint/endpoint/long/path";
- Endpoint endpoint2 = publishEndpoint1(new Endpoint1Impl(), publishURL2);
-
- invokeEndpoint1(publishURL1);
- invokeEndpoint1(publishURL2);
-
- endpoint1.stop();
- endpoint2.stop();
- }
-
- public void testSamePortsAndAlmostIdenticalLongPaths() throws Exception
- {
- String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/number1/";
- Endpoint endpoint1 = publishEndpoint2(Endpoint1Impl.class, publishURL1);
-
- String publishURL2 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/number11";
- Endpoint endpoint2 = publishEndpoint3(new Endpoint1Impl(), publishURL2);
-
- invokeEndpoint2(publishURL1);
- invokeEndpoint2(publishURL2);
-
- endpoint1.stop();
- endpoint2.stop();
- }
-
- public void testDifferentPortsAndIdenticalPaths() throws Exception
- {
- String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/number1/";
- Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
-
- String publishURL2 = "http://" + getServerHost() + ":" + port2
+ "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
-
- invokeEndpoint2(publishURL1);
- invokeEndpoint2(publishURL2);
-
- endpoint1.stop();
- endpoint2.stop();
- }
-
- public void testEndpointThrowingException() throws Exception
- {
- String publishURL = "http://" + getServerHost() + ":" + port1 +
"/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint = publishEndpoint3(Endpoint1Impl.class, publishURL);
- invokeEndpoint3(publishURL);
- endpoint.stop();
- }
-
- public void testEndpointProcessingAttachments() throws Exception
- {
- for (int i = 0; i < 2; i++)
- {
- String publishURL = "http://" + getServerHost() + ":" +
port1 + "/jaxws-endpoint/endpoint/number1";
- Endpoint endpoint = publishEndpoint3(Endpoint1Impl.class, publishURL);
- invokeEndpoint4(publishURL);
- endpoint.stop();
- }
- }
-
- private Endpoint publishEndpoint1(Object epImpl, String publishURL)
- {
- Endpoint endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl);
- endpoint.publish(publishURL);
- return endpoint;
- }
-
- private Endpoint publishEndpoint2(Object epImpl, String publishURL)
- {
- Endpoint endpoint = Endpoint.create(epImpl);
- endpoint.publish(publishURL);
- return endpoint;
- }
-
- private Endpoint publishEndpoint3(Object epImpl, String publishURL)
- {
- return Endpoint.publish(publishURL, epImpl);
- }
-
- private void invokeEndpoint1(String publishURL) throws Exception
- {
- Endpoint1Iface port = this.getProxy(publishURL);
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
- }
-
- private void invokeEndpoint2(String publishURL) throws Exception
- {
- Endpoint1Iface port = this.getProxy(publishURL);
-
- String helloWorld = "Hello world!";
-
- assertEquals(0, port.getCount());
- Object retObj = port.echo(helloWorld);
-
- assertEquals(helloWorld, retObj);
- assertEquals(1, port.getCount());
-
- port.echo(helloWorld);
- assertEquals(2, port.getCount());
- }
-
- private void invokeEndpoint3(String publishURL) throws Exception
- {
- Endpoint1Iface port = this.getProxy(publishURL);
-
- try
- {
- port.getException();
- fail("Failure expected");
- }
- catch (Exception e)
- {
- assertEquals("Ooops", e.getMessage());
- }
- }
-
- private void invokeEndpoint4(String publishURL) throws Exception
- {
- Endpoint1Iface port = this.getProxy(publishURL, mtomEnabled);
-
- DataSource ds = new DataSource()
- {
- public String getContentType() { return "text/plain"; }
- public InputStream getInputStream() throws IOException { return new
ByteArrayInputStream("some string".getBytes()); }
- public String getName() { return "none"; }
- public OutputStream getOutputStream() throws IOException { return null; }
- };
- DataHandler dh = new DataHandler(ds);
- DHResponse response = port.echoDataHandler(new DHRequest(dh));
- assertNotNull(response);
-
- Object content = response.getDataHandler().getContent();
- assertEquals("Server data", content);
- String contentType = response.getDataHandler().getContentType();
- assertEquals("text/plain", contentType);
- }
-
- private Endpoint1Iface getProxy(String publishURL) throws Exception
- {
- return this.getProxy(publishURL, null);
- }
-
- private Endpoint1Iface getProxy(String publishURL, WebServiceFeature[] features)
throws Exception
- {
- URL wsdlURL = new URL(publishURL + "?wsdl");
- QName qname = new
QName("http://org.jboss.ws/jaxws/endpoint/jse/endpoints/",
"Endpoint1Impl");
- Service service = Service.create(wsdlURL, qname);
- return (Endpoint1Iface)service.getPort(Endpoint1Iface.class, features);
- }
-
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
(from rev 10915,
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,244 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.endpoint.jse;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.MTOMFeature;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHRequest;
+import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.DHResponse;
+import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Iface;
+import org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Impl;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * Tests endpoint dynamic publishing in JSE environment.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class UsecasesTestCase extends JBossWSTest
+{
+ private static WebServiceFeature[] mtomEnabled = new WebServiceFeature[] { new
MTOMFeature(true) };
+
+ private static int port1 = 8871;
+ private static int port2 = 8872;
+
+ public void testDifferentPortsSameContext() throws Exception
+ {
+ String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/";
+ Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
+
+ String publishURL2 = "http://" + getServerHost() + ":" + port2
+ "/jaxws-endpoint";
+ Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
+
+ invokeEndpoint1(publishURL1);
+ invokeEndpoint1(publishURL2);
+
+ endpoint1.stop();
+ endpoint2.stop();
+ }
+
+ public void testDifferentPortsNoContext() throws Exception
+ {
+ String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/";
+ Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
+
+ String publishURL2 = "http://" + getServerHost() + ":" +
port2;
+ Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
+
+ invokeEndpoint1(publishURL1);
+ invokeEndpoint1(publishURL2);
+
+ endpoint1.stop();
+ endpoint2.stop();
+ }
+
+ public void testDifferentPortsAndLongPaths() throws Exception
+ {
+ String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/long/path/";
+ Endpoint endpoint1 = publishEndpoint3(Endpoint1Impl.class, publishURL1);
+
+ String publishURL2 = "http://" + getServerHost() + ":" + port2
+ "/jaxws-endpoint/endpoint/long/path";
+ Endpoint endpoint2 = publishEndpoint1(new Endpoint1Impl(), publishURL2);
+
+ invokeEndpoint1(publishURL1);
+ invokeEndpoint1(publishURL2);
+
+ endpoint1.stop();
+ endpoint2.stop();
+ }
+
+ public void testSamePortsAndAlmostIdenticalLongPaths() throws Exception
+ {
+ String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/number1/";
+ Endpoint endpoint1 = publishEndpoint2(Endpoint1Impl.class, publishURL1);
+
+ String publishURL2 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/number11";
+ Endpoint endpoint2 = publishEndpoint3(new Endpoint1Impl(), publishURL2);
+
+ invokeEndpoint2(publishURL1);
+ invokeEndpoint2(publishURL2);
+
+ endpoint1.stop();
+ endpoint2.stop();
+ }
+
+ public void testDifferentPortsAndIdenticalPaths() throws Exception
+ {
+ String publishURL1 = "http://" + getServerHost() + ":" + port1
+ "/jaxws-endpoint/endpoint/number1/";
+ Endpoint endpoint1 = publishEndpoint1(Endpoint1Impl.class, publishURL1);
+
+ String publishURL2 = "http://" + getServerHost() + ":" + port2
+ "/jaxws-endpoint/endpoint/number1";
+ Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
+
+ invokeEndpoint2(publishURL1);
+ invokeEndpoint2(publishURL2);
+
+ endpoint1.stop();
+ endpoint2.stop();
+ }
+
+ public void testEndpointThrowingException() throws Exception
+ {
+ String publishURL = "http://" + getServerHost() + ":" + port1 +
"/jaxws-endpoint/endpoint/number1";
+ Endpoint endpoint = publishEndpoint3(Endpoint1Impl.class, publishURL);
+ invokeEndpoint3(publishURL);
+ endpoint.stop();
+ }
+
+ public void testEndpointProcessingAttachments() throws Exception
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ String publishURL = "http://" + getServerHost() + ":" +
port1 + "/jaxws-endpoint/endpoint/number1";
+ Endpoint endpoint = publishEndpoint3(Endpoint1Impl.class, publishURL);
+ invokeEndpoint4(publishURL);
+ endpoint.stop();
+ }
+ }
+
+ private Endpoint publishEndpoint1(Object epImpl, String publishURL)
+ {
+ Endpoint endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl);
+ endpoint.publish(publishURL);
+ return endpoint;
+ }
+
+ private Endpoint publishEndpoint2(Object epImpl, String publishURL)
+ {
+ Endpoint endpoint = Endpoint.create(epImpl);
+ endpoint.publish(publishURL);
+ return endpoint;
+ }
+
+ private Endpoint publishEndpoint3(Object epImpl, String publishURL)
+ {
+ return Endpoint.publish(publishURL, epImpl);
+ }
+
+ private void invokeEndpoint1(String publishURL) throws Exception
+ {
+ Endpoint1Iface port = this.getProxy(publishURL);
+
+ String helloWorld = "Hello world!";
+ Object retObj = port.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ private void invokeEndpoint2(String publishURL) throws Exception
+ {
+ Endpoint1Iface port = this.getProxy(publishURL);
+
+ String helloWorld = "Hello world!";
+
+ assertEquals(0, port.getCount());
+ Object retObj = port.echo(helloWorld);
+
+ assertEquals(helloWorld, retObj);
+ assertEquals(1, port.getCount());
+
+ port.echo(helloWorld);
+ assertEquals(2, port.getCount());
+ }
+
+ private void invokeEndpoint3(String publishURL) throws Exception
+ {
+ Endpoint1Iface port = this.getProxy(publishURL);
+
+ try
+ {
+ port.getException();
+ fail("Failure expected");
+ }
+ catch (Exception e)
+ {
+ assertEquals("Ooops", e.getMessage());
+ }
+ }
+
+ private void invokeEndpoint4(String publishURL) throws Exception
+ {
+ Endpoint1Iface port = this.getProxy(publishURL, mtomEnabled);
+
+ DataSource ds = new DataSource()
+ {
+ public String getContentType() { return "text/plain"; }
+ public InputStream getInputStream() throws IOException { return new
ByteArrayInputStream("some string".getBytes()); }
+ public String getName() { return "none"; }
+ public OutputStream getOutputStream() throws IOException { return null; }
+ };
+ DataHandler dh = new DataHandler(ds);
+ DHResponse response = port.echoDataHandler(new DHRequest(dh));
+ assertNotNull(response);
+
+ Object content = response.getDataHandler().getContent();
+ assertEquals("Server data", content);
+ String contentType = response.getDataHandler().getContentType();
+ assertEquals("text/plain", contentType);
+ }
+
+ private Endpoint1Iface getProxy(String publishURL) throws Exception
+ {
+ return this.getProxy(publishURL, null);
+ }
+
+ private Endpoint1Iface getProxy(String publishURL, WebServiceFeature[] features)
throws Exception
+ {
+ URL wsdlURL = new URL(publishURL + "?wsdl");
+ QName qname = new
QName("http://org.jboss.ws/jaxws/endpoint/jse/endpoints/",
"Endpoint1Impl");
+ Service service = Service.create(wsdlURL, qname);
+ return (Endpoint1Iface)service.getPort(Endpoint1Iface.class, features);
+ }
+
+}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints
(from rev 10915,
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints)
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java
===================================================================
---
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.annotation.XmlMimeType;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType
-(
- name = "dataRequest",
- namespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/"
-)
-public class DHRequest
-{
-
- private DataHandler dataHandler;
-
- public DHRequest()
- {
- }
-
- public DHRequest(DataHandler dataHandler)
- {
- this.dataHandler = dataHandler;
- }
-
- @XmlMimeType("text/plain")
- public DataHandler getDataHandler()
- {
- return dataHandler;
- }
-
- public void setDataHandler(DataHandler dataHandler)
- {
- this.dataHandler = dataHandler;
- }
-
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java
(from rev 10915,
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHRequest.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType
+(
+ name = "dataRequest",
+ namespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/"
+)
+public class DHRequest
+{
+
+ private DataHandler dataHandler;
+
+ public DHRequest()
+ {
+ }
+
+ public DHRequest(DataHandler dataHandler)
+ {
+ this.dataHandler = dataHandler;
+ }
+
+ @XmlMimeType("text/plain")
+ public DataHandler getDataHandler()
+ {
+ return dataHandler;
+ }
+
+ public void setDataHandler(DataHandler dataHandler)
+ {
+ this.dataHandler = dataHandler;
+ }
+
+}
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java
===================================================================
---
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.annotation.XmlMimeType;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType
-(
- name="dataResponse",
- namespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/"
-)
-public class DHResponse {
-
-
- private DataHandler dataHandler;
-
-
- public DHResponse() {
- }
-
- public DHResponse(DataHandler dataHandler) {
- this.dataHandler = dataHandler;
- }
-
- @XmlMimeType("text/plain")
- public DataHandler getDataHandler() {
- return dataHandler;
- }
-
- public void setDataHandler(DataHandler dataHandler) {
- this.dataHandler = dataHandler;
- }
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java
(from rev 10915,
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/DHResponse.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType
+(
+ name="dataResponse",
+ namespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/"
+)
+public class DHResponse {
+
+
+ private DataHandler dataHandler;
+
+
+ public DHResponse() {
+ }
+
+ public DHResponse(DataHandler dataHandler) {
+ this.dataHandler = dataHandler;
+ }
+
+ @XmlMimeType("text/plain")
+ public DataHandler getDataHandler() {
+ return dataHandler;
+ }
+
+ public void setDataHandler(DataHandler dataHandler) {
+ this.dataHandler = dataHandler;
+ }
+}
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
===================================================================
---
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
-
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-/**
- * Service interface.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-@WebService(targetNamespace =
"http://org.jboss.ws/jaxws/endpoint/jse/endpoints/")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface Endpoint1Iface
-{
- String echo(String input);
- int getCount();
- void getException();
- DHResponse echoDataHandler(DHRequest request);
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
(from rev 10915,
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * Service interface.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService(targetNamespace =
"http://org.jboss.ws/jaxws/endpoint/jse/endpoints/")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint1Iface
+{
+ String echo(String input);
+ int getCount();
+ void getException();
+ DHResponse echoDataHandler(DHRequest request);
+}
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
===================================================================
---
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-15
14:38:02 UTC (rev 10915)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
-
-import java.io.IOException;
-
-import javax.activation.DataHandler;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.MTOM;
-
-/**
- * Service implementation.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-@WebService
-(
- serviceName = "Endpoint1Impl",
- targetNamespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/",
- endpointInterface =
"org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Iface"
-)
-@MTOM
-public class Endpoint1Impl implements Endpoint1Iface
-{
-
- private int count;
- private boolean initialized;
-
- public String echo(String input)
- {
- count++;
- return input;
- }
-
- @PostConstruct
- public void init()
- {
- System.out.println("Endpoint initialized: " + this);
- this.initialized = true;
- }
-
- @PreDestroy
- public void destroy()
- {
- System.out.println("Endpoint destroyed: " + this);
- }
-
- public int getCount()
- {
- this.ensureInit();
- return count;
- }
-
- public void getException()
- {
- this.ensureInit();
- throw new WebServiceException("Ooops");
- }
-
- public DHResponse echoDataHandler(DHRequest request)
- {
- this.ensureInit();
- DataHandler dataHandler = request.getDataHandler();
-
- try
- {
- if (!dataHandler.getContentType().equals("text/plain"))
- {
- throw new WebServiceException("Wrong content type");
- }
- if (!dataHandler.getContent().equals("some string"))
- {
- throw new WebServiceException("Wrong data");
- }
- }
- catch (IOException e)
- {
- throw new WebServiceException(e);
- }
-
- DataHandler responseData = new DataHandler("Server data",
"text/plain");
- return new DHResponse(responseData);
- }
-
- private void ensureInit()
- {
- if (!this.initialized)
- throw new IllegalStateException();
- }
-
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
(from rev 10915,
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-15
23:06:37 UTC (rev 10922)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
+
+import java.io.IOException;
+
+import javax.activation.DataHandler;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.MTOM;
+
+/**
+ * Service implementation.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService
+(
+ serviceName = "Endpoint1Impl",
+ targetNamespace = "http://org.jboss.ws/jaxws/endpoint/jse/endpoints/",
+ endpointInterface =
"org.jboss.test.ws.jaxws.endpoint.jse.endpoints.Endpoint1Iface"
+)
+@MTOM
+public class Endpoint1Impl implements Endpoint1Iface
+{
+
+ private int count;
+ private boolean initialized;
+
+ public String echo(String input)
+ {
+ count++;
+ return input;
+ }
+
+ @PostConstruct
+ public void init()
+ {
+ System.out.println("Endpoint initialized: " + this);
+ this.initialized = true;
+ }
+
+ @PreDestroy
+ public void destroy()
+ {
+ System.out.println("Endpoint destroyed: " + this);
+ }
+
+ public int getCount()
+ {
+ this.ensureInit();
+ return count;
+ }
+
+ public void getException()
+ {
+ this.ensureInit();
+ throw new WebServiceException("Ooops");
+ }
+
+ public DHResponse echoDataHandler(DHRequest request)
+ {
+ this.ensureInit();
+ DataHandler dataHandler = request.getDataHandler();
+
+ try
+ {
+ if (!dataHandler.getContentType().equals("text/plain"))
+ {
+ throw new WebServiceException("Wrong content type");
+ }
+ if (!dataHandler.getContent().equals("some string"))
+ {
+ throw new WebServiceException("Wrong data");
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ DataHandler responseData = new DataHandler("Server data",
"text/plain");
+ return new DHResponse(responseData);
+ }
+
+ private void ensureInit()
+ {
+ if (!this.initialized)
+ throw new IllegalStateException();
+ }
+
+}
Modified: stack/native/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/native/trunk/modules/testsuite/pom.xml 2009-10-15 23:02:53 UTC (rev 10921)
+++ stack/native/trunk/modules/testsuite/pom.xml 2009-10-15 23:06:37 UTC (rev 10922)
@@ -327,16 +327,6 @@
</properties>
<dependencies>
<dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss500</artifactId>
- <exclusions>
- <exclusion> <!-- Exclude old jaxws impl transitive dependency
brought in by jboss-metadata -->
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
@@ -399,16 +389,6 @@
</properties>
<dependencies>
<dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss501</artifactId>
- <exclusions>
- <exclusion> <!-- Exclude old jaxws impl transitive dependency
brought in by jboss-metadata -->
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
@@ -471,16 +451,6 @@
</properties>
<dependencies>
<dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss510</artifactId>
- <exclusions>
- <exclusion>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
@@ -531,27 +501,7 @@
<jbossws.integration.target>jboss520</jbossws.integration.target>
</properties>
<dependencies>
- <!-- [JBWS-2505] -->
- <!-- START -->
- <!--
<dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss520x</artifactId>
- <exclusions>
- <exclusion>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- -->
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-webservices</artifactId>
- <version>${jboss.version}</version>
- </dependency>
- <!-- END -->
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
@@ -602,27 +552,7 @@
<jbossws.integration.target>jboss600</jbossws.integration.target>
</properties>
<dependencies>
- <!-- [JBWS-2505] -->
- <!-- START -->
- <!--
<dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600x</artifactId>
- <exclusions>
- <exclusion>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- -->
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-webservices</artifactId>
- <version>${jboss.version}</version>
- </dependency>
- <!-- END -->
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>