From 56016859f125828b466323f2790039020bf3a891 Mon Sep 17 00:00:00 2001 From: Rafael Benevides Date: Mon, 7 Sep 2015 12:58:26 -0400 Subject: [PATCH] Remove trailing spaces from files --- .../appclient/acc/client/Main.java | 6 +- .../client/interceptor/ClientInterceptor.java | 2 +- .../server/ejb/StatelessSession.java | 4 +- .../server/ejb/StatelessSessionBean.java | 8 +- .../quickstarts/batch/controller/JobData.java | 4 +- .../batch/job/ChunkCheckpoint.java | 6 +- .../as/quickstarts/batch/util/Resources.java | 4 +- .../Address.java | 2 +- .../AddressValidator.java | 8 +- .../Person.java | 10 +- .../PersonAddress.java | 8 +- .../MyPersonTest.java | 12 +- .../test/MemberValidationTest.java | 12 +- .../as/quickstarts/bmt/ManagedComponent.java | 2 +- .../quickstarts/bmt/TransactionServlet.java | 2 +- .../quickstarts/bmt/UnManagedComponent.java | 4 +- .../as/quickstarts/cdi/alternative/Demo.java | 4 +- .../as/quickstarts/cdi/alternative/Tax.java | 58 ++-- .../cdi/alternative/TaxImpl_1.java | 62 ++-- .../cdi/alternative/TaxImpl_2.java | 72 ++--- .../as/quickstarts/cdi/decorator/Staff.java | 2 +- .../cdi/decorator/StaffController.java | 6 +- .../cdi/decorator/StaffServiceDecorator.java | 8 +- .../cdi/decorator/StaffServiceImpl.java | 4 +- .../injection/EnglishTranslateService.java | 6 +- .../injection/SpanishTranslateService.java | 4 +- .../cdi/injection/TranslateService.java | 2 +- .../backing/TranslationBackingBean.java | 4 +- .../cdi/injection/qualifier/English.java | 4 +- .../cdi/injection/qualifier/Spanish.java | 6 +- .../cdi/interceptor/AuditInterceptor.java | 2 +- .../cdi/interceptor/LoggingInterceptor.java | 2 +- .../as/quickstarts/cdi/service/History.java | 2 +- .../as/quickstarts/cdi/service/Item.java | 2 +- .../as/quickstarts/cdi/service/ItemBean.java | 4 +- .../cdi/service/ItemServiceBean.java | 2 +- .../as/quickstarts/cdi/util/Resources.java | 4 +- .../test/InterceptorsEnabledTest.java | 2 +- .../cdi/interceptor/AuditInterceptor.java | 2 +- .../cdi/interceptor/LoggingInterceptor.java | 2 +- .../cdi/interceptor/ServiceStereotype.java | 2 +- .../as/quickstarts/cdi/service/History.java | 2 +- .../as/quickstarts/cdi/service/Item.java | 2 +- .../service/ItemAlternativeServiceBean.java | 2 +- .../as/quickstarts/cdi/service/ItemBean.java | 4 +- .../cdi/service/ItemServiceBean.java | 2 +- .../as/quickstarts/cdi/util/Resources.java | 4 +- .../service/ejb/HATimerService.java | 2 +- .../hasingleton/service/ejb/Scheduler.java | 2 +- .../cmt/ejb/CustomerManagerEJB.java | 2 +- .../cmt/ejb/InvoiceManagerEJB.java | 2 +- .../cmt/ejb/LogMessageManagerEJB.java | 2 +- .../as/quickstarts/cmt/mdb/HelloWorldMDB.java | 4 +- .../jboss/quickstarts/contact/Contact.java | 16 +- .../contact/ContactRESTService.java | 46 +-- .../contact/ContactRepository.java | 74 ++--- .../quickstarts/contact/ContactService.java | 52 ++-- .../quickstarts/contact/ContactValidator.java | 12 +- .../quickstarts/contact/JaxRsActivator.java | 4 +- .../quickstarts/util/JSONPRequestFilter.java | 4 +- .../jboss/quickstarts/util/JacksonConfig.java | 6 +- .../org/jboss/quickstarts/util/Resources.java | 4 +- .../contact/test/ContactRegistrationTest.java | 42 +-- .../client/AsynchronousClient.java | 14 +- .../AnotherAsynchronousAccess.java | 6 +- .../ejb/asynchronous/AsynchronousAccess.java | 6 +- .../asynchronous/AsynchronousAccessBean.java | 2 +- .../ejb/asynchronous/ParallelAccess.java | 2 +- .../ejb/asynchronous/ParallelAccessBean.java | 2 +- .../as/quickstarts/ear/ejb/GreeterEJB.java | 4 +- .../quickstarts/ear/controller/Greeter.java | 6 +- .../ejbinwar/controller/Greeter.java | 6 +- .../quickstarts/ejbinwar/ejb/GreeterEJB.java | 4 +- .../ejbinwar/test/GreeterEJBTest.java | 2 +- .../ejbinwar/test/GreeterTest.java | 2 +- .../ejb/multi/server/app/MainApp.java | 2 +- .../ejb/multi/server/app/MainAppBean.java | 6 +- .../multi/server/app/MainAppSContextBean.java | 42 +-- .../ejb/multi/server/app/EjbInvocation.java | 2 +- .../ejb/multi/server/app/JsfController.java | 4 +- .../ejb/multi/server/app/AppOne.java | 6 +- .../ejb/multi/server/app/AppOneBean.java | 4 +- .../ejb/multi/server/app/AppTwo.java | 6 +- .../ejb/multi/server/app/AppTwoBean.java | 2 +- .../web/multi/server/app/Servlet.java | 2 +- .../quickstarts/ejb/multi/server/Client.java | 6 +- .../ejb/remote/client/RemoteEJBClient.java | 10 +- .../ClientSecurityInterceptor.java | 2 +- .../DelegationLoginModule.java | 12 +- .../IntermediateEJB.java | 2 +- .../IntermediateEJBRemote.java | 2 +- .../RemoteClient.java | 2 +- .../ejb_security_interceptors/SecuredEJB.java | 2 +- .../SecuredEJBRemote.java | 2 +- .../quickstarts/ejb_security/SecuredEJB.java | 8 +- .../ejb_security/SecuredEJBServlet.java | 4 +- .../ear/client/GreeterEJBLocal.java | 2 +- .../ear/client/GreeterException.java | 2 +- .../as/quickstarts/ear/ejb/GreeterEJB.java | 10 +- .../ear/controller/GreeterBean.java | 22 +- .../quickstarts/ejbTimer/ScheduleExample.java | 6 +- .../quickstarts/ejbTimer/TimeoutExample.java | 10 +- .../quickstarts/html5rest/HelloService.java | 4 +- .../as/quickstarts/html5rest/HelloWorld.java | 2 +- .../mbean/IHelloWorldMXBean.java | 86 +++--- .../mbean/MXPojoHelloWorld.java | 122 ++++---- .../mbean/MXPojoHelloWorldTest.java | 146 +++++----- .../mbean/AbstractComponentMBean.java | 142 +++++----- .../mbean/AnnotatedComponentHelloWorld.java | 138 ++++----- .../mbean/IAnnotatedHelloWorldMBean.java | 90 +++--- .../mbean/IHelloWorldMXBean.java | 86 +++--- .../mbean/MXComponentHelloWorld.java | 138 ++++----- .../mbean/MXPojoHelloWorld.java | 114 ++++---- .../mbeanhelloworld/service/HelloService.java | 60 ++-- .../mbeanhelloworld/util/CDIExtension.java | 4 +- .../AnnotatedComponentHelloWorldTest.java | 148 +++++----- .../mbean/MXComponentHelloWorldTest.java | 152 +++++----- .../mbean/MXPojoHelloWorldTest.java | 158 +++++------ .../quickstarts/mdb/HelloWorldQueueMDB.java | 6 +- .../quickstarts/mdb/HelloWorldTopicMDB.java | 6 +- .../servlet/HelloWorldMDBServletClient.java | 222 +++++++-------- .../quickstarts/mdb/HelloWorldQueueMDB.java | 4 +- .../quickstarts/mdb/HelloWorldTopicMDB.java | 4 +- .../servlet/HelloWorldMDBServletClient.java | 222 +++++++-------- .../rshelloworld/HelloService.java | 4 +- .../quickstarts/rshelloworld/HelloWorld.java | 4 +- .../as/quickstarts/singleton/Counter.java | 4 +- .../wshelloworld/HelloWorldService.java | 8 +- .../wshelloworld/HelloWorldServiceImpl.java | 6 +- .../as/quickstarts/wshelloworld/Client.java | 8 +- .../wshelloworld/ClientArqTest.java | 2 +- .../quickstarts/wshelloworld/ClientTest.java | 18 +- .../quickstarts/helloworld/HelloService.java | 4 +- .../helloworld/HelloWorldServlet.java | 6 +- .../as/quickstart/hibernate/model/Member.java | 2 +- .../quickstart/hibernate/util/Resources.java | 4 +- .../interapp/appA/ControllerA.java | 4 +- .../as/quickstarts/interapp/appA/FooImpl.java | 6 +- .../as/quickstarts/interapp/appA/Imports.java | 4 +- .../as/quickstarts/interapp/appB/BarImpl.java | 10 +- .../interapp/appB/ControllerB.java | 4 +- .../as/quickstarts/interapp/appB/Imports.java | 4 +- .../as/quickstarts/interapp/shared/Bar.java | 2 +- .../as/quickstarts/interapp/shared/Foo.java | 4 +- .../jaxrsclient/model/Contact.java | 6 +- .../jaxrsclient/rest/JaxRsActivator.java | 4 +- .../jaxws/samples/wsa/AddressingTestCase.java | 2 +- .../ws/jaxws/samples/wsa/ServiceIface.java | 2 +- .../jboss/quickstarts/ws/client/Client.java | 2 +- .../jsr181pojo/EJB3RemoteInterface.java | 2 +- .../jboss/quickstarts/ws/client/Client.java | 2 +- .../jaxws/samples/jsr181pojo/JSEBean01.java | 2 +- .../samples/jsr181pojo/JSEBean01Service.java | 12 +- .../jaxws/samples/jsr181pojo/JSEBean01.java | 2 +- .../jboss/quickstarts/ws/client/Client.java | 2 +- .../retail/profile/ProfileMgmtBean.java | 4 +- .../as/quickstarts/jsonp/JsonController.java | 8 +- .../jboss/as/quickstarts/xa/DbUpdaterMDB.java | 4 +- .../org/jboss/as/quickstarts/xa/KVPair.java | 2 +- .../jboss/as/quickstarts/xa/XAService.java | 10 +- .../jboss/as/quickstarts/xa/XAServlet.java | 6 +- .../cmt/jts/ejb/CustomerManagerEJB.java | 2 +- .../cmt/jts/mdb/HelloWorldMDB.java | 4 +- .../kitchensink_ear/util/Resources.java | 4 +- .../kitchensink_ear/rest/JaxRsActivator.java | 2 +- .../rest/MemberResourceRESTService.java | 6 +- .../kitchensink_ear/util/WebResources.java | 4 +- .../html5_mobile/rest/JaxRsActivator.java | 2 +- .../html5_mobile/rest/MemberService.java | 6 +- .../html5_mobile/util/JSONPRequestFilter.java | 6 +- .../html5_mobile/util/Resources.java | 4 +- .../test/MemberRegistrationTest.java | 2 +- .../kitchensinkjsp/rest/JaxRsActivator.java | 2 +- .../rest/MemberResourceRESTService.java | 2 +- .../servlet/MemberRegistrationServlet.java | 226 +++++++-------- .../kitchensinkjsp/util/Resources.java | 4 +- .../kitchensink_ear/util/Resources.java | 4 +- .../kitchensink_ear/rest/JaxRsActivator.java | 2 +- .../rest/MemberResourceRESTService.java | 6 +- .../kitchensink_ear/util/WebResources.java | 4 +- .../kitchensink/rest/JaxRsActivator.java | 2 +- .../rest/MemberResourceRESTService.java | 6 +- .../kitchensink/util/Resources.java | 4 +- .../kitchensink/rest/JaxRsActivator.java | 2 +- .../rest/MemberResourceRESTService.java | 6 +- .../kitchensink/util/Resources.java | 4 +- .../as/quickstarts/log4jdemo/Log4jDemo.java | 4 +- .../loggingToolsQS/GreeterService.java | 2 +- .../org/jboss/as/quickstarts/mail/Email.java | 6 +- .../managedexecutorservice/model/Product.java | 2 +- .../rest/JaxRsActivator.java | 4 +- .../util/Resources.java | 6 +- .../test/ProductsRestClientTest.java | 2 +- .../as/quickstarts/numberguess/Game.java | 6 +- .../as/quickstarts/numberguess/Generator.java | 8 +- .../as/quickstarts/numberguess/MaxNumber.java | 4 +- .../as/quickstarts/numberguess/Random.java | 4 +- .../payment/beans/PaymentBean.java | 248 ++++++++-------- .../payment/events/PaymentEvent.java | 112 ++++---- .../payment/events/PaymentTypeEnum.java | 94 +++---- .../payment/handler/ICreditEventObserver.java | 68 ++--- .../payment/handler/IDebitEventObserver.java | 68 ++--- .../payment/handler/PaymentHandler.java | 132 ++++----- .../payment/qualifiers/Credit.java | 66 ++--- .../quickstarts/payment/qualifiers/Debit.java | 66 ++--- .../payment/resources/Resources.java | 4 +- .../picketlink/WSTrustClientExample.java | 10 +- .../app/sts/PicketLinkSTService.java | 4 +- .../jaxrsclient/JaxRsClientTest.java | 14 +- .../servlet/async/AsynchronousServlet.java | 8 +- .../servlet/async/LongRunningService.java | 4 +- .../filterlistener/FilterExampleServlet.java | 2 +- .../ParameterDumpingRequestListener.java | 2 +- .../filterlistener/VowelRemoverFilter.java | 4 +- .../servlet_security/SecuredServlet.java | 4 +- .../shrinkwrap/resolver/MyBean.java | 6 +- .../resolver/ShrinkwrapImportFromPomTest.java | 6 +- ...olveGAPCVCustomRepoWithoutCentralTest.java | 6 +- ...apResolveGAVWithoutTransitiveDepsTest.java | 4 +- .../greeter/greeter_spring/domain/User.java | 2 +- .../greeter_spring/domain/UserDao.java | 2 +- .../greeter_spring/domain/UserDaoImpl.java | 2 +- .../greeter_spring/web/GreetController.java | 2 +- .../controller/MemberController.java | 2 +- .../asyncrequestmapping/model/Member.java | 2 +- .../basic/controller/MemberController.java | 2 +- .../spring/basic/model/Member.java | 2 +- .../controller/MemberController.java | 2 +- .../spring/controlleradvice/model/Member.java | 2 +- .../matrixvariables/config/WebConfig.java | 24 +- .../controller/MemberController.java | 16 +- .../matrixvariables/data/MemberDaoImpl.java | 8 +- .../spring/matrixvariables/model/Member.java | 2 +- .../controller/MemberController.java | 2 +- .../spring/springmvctest/model/Member.java | 2 +- .../samples/petclinic/model/package-info.java | 44 +-- .../jdbc/JdbcPetVisitExtractor.java | 2 +- .../repository/jdbc/package-info.java | 46 +-- .../jpa/JpaOwnerRepositoryImpl.java | 6 +- .../repository/jpa/JpaPetRepositoryImpl.java | 4 +- .../jpa/JpaVisitRepositoryImpl.java | 4 +- .../repository/jpa/package-info.java | 46 +-- .../SpringDataOwnerRepository.java | 4 +- .../petclinic/util/CallMonitoringAspect.java | 2 +- .../petclinic/web/OwnerController.java | 2 +- .../samples/petclinic/web/PetValidator.java | 4 +- .../samples/petclinic/web/VetController.java | 6 +- .../petclinic/web/VisitController.java | 6 +- .../petclinic/model/ValidatorTests.java | 8 +- .../service/AbstractClinicServiceTests.java | 20 +- .../service/ClinicServiceJdbcTests.java | 2 +- .../service/ClinicServiceJpaTests.java | 4 +- .../ClinicServiceSpringDataJpaTests.java | 4 +- .../resteasyspring/GreetingBean.java | 4 +- .../resteasyspring/HelloSpringResource.java | 16 +- .../resteasyspring/LocatingResource.java | 2 +- .../as/quickstarts/tasksJsf/Resources.java | 8 +- .../as/quickstarts/tasksJsf/TaskDao.java | 4 +- .../as/quickstarts/tasksJsf/TaskDaoImpl.java | 4 +- .../jboss/as/quickstarts/tasksJsf/User.java | 2 +- .../as/quickstarts/tasksJsf/UserDao.java | 4 +- .../as/quickstarts/tasksJsf/UserDaoImpl.java | 4 +- .../tasksJsf/FacesContextStub.java | 4 +- .../as/quickstarts/tasksJsf/TaskDaoStub.java | 2 +- .../tasksrs/model/TaskDaoImpl.java | 2 +- .../tasksrs/model/UserDaoImpl.java | 2 +- .../jboss/as/quickstarts/tasks/Resources.java | 4 +- .../org/jboss/as/quickstarts/tasks/Task.java | 2 +- .../jboss/as/quickstarts/tasks/TaskDao.java | 4 +- .../as/quickstarts/tasks/TaskDaoImpl.java | 4 +- .../org/jboss/as/quickstarts/tasks/User.java | 2 +- .../jboss/as/quickstarts/tasks/UserDao.java | 4 +- .../as/quickstarts/tasks/UserDaoImpl.java | 4 +- .../controller/ScaleConverter.java | 4 +- .../controller/TemperatureConverter.java | 6 +- .../temperatureconverter/ejb/Scale.java | 6 +- .../temperatureconverter/ejb/Temperature.java | 6 +- .../ejb/TemperatureConvertEJB.java | 4 +- .../websocket/BidWebSocketEndpoint.java | 6 +- .../quickstarts/websocket/MessageDecoder.java | 4 +- .../quickstarts/websocket/model/Item.java | 2 +- .../websocket_hello/HelloName.java | 2 +- .../wsat/simple/MockRestaurantManager.java | 16 +- .../wsat/simple/RestaurantParticipant.java | 10 +- .../wsat/simple/RestaurantServiceATImpl.java | 8 +- .../simple/jaxws/RestaurantServiceAT.java | 4 +- .../jaxws/RestaurantServiceATService.java | 6 +- .../servlet/WSATSimpleServletClient.java | 264 +++++++++--------- .../as/quickstarts/wsat/simple/Client.java | 6 +- .../quickstarts/wsat/simple/ClientStub.java | 4 +- .../quickstarts/wsat/simple/ClientTest.java | 10 +- .../simple/AlreadyInSetException.java | 2 +- .../simple/MockSetManager.java | 20 +- .../simple/SetParticipantBA.java | 20 +- .../simple/SetServiceBAImpl.java | 6 +- .../simple/SetServiceException.java | 2 +- .../simple/jaxws/SetServiceBA.java | 8 +- .../simple/jaxws/SetServiceBAService.java | 4 +- .../coordinatorcompletion/simple/Client.java | 8 +- .../simple/ClientStub.java | 4 +- .../simple/ClientTest.java | 10 +- .../simple/AlreadyInSetException.java | 2 +- .../simple/MockSetManager.java | 20 +- .../simple/SetParticipantBA.java | 14 +- .../simple/SetServiceBAImpl.java | 6 +- .../simple/SetServiceException.java | 4 +- .../simple/jaxws/SetServiceBA.java | 8 +- .../simple/jaxws/SetServiceBAService.java | 4 +- .../participantcompletion/simple/Client.java | 8 +- .../simple/ClientStub.java | 4 +- .../simple/ClientTest.java | 10 +- .../org/jboss/as/quickstart/xml/Book.java | 4 +- .../as/quickstart/xml/DOM4JXMLParser.java | 4 +- .../org/jboss/as/quickstart/xml/Error.java | 4 +- .../org/jboss/as/quickstart/xml/Errors.java | 4 +- .../jboss/as/quickstart/xml/XMLParser.java | 6 +- .../quickstart/xml/upload/FileUploadBean.java | 6 +- .../xml/upload/FileUploadServlet.java | 6 +- .../org/jboss/as/quickstart/xml/Book.java | 4 +- .../jboss/as/quickstart/xml/DOMXMLParser.java | 4 +- .../org/jboss/as/quickstart/xml/Error.java | 4 +- .../org/jboss/as/quickstart/xml/Errors.java | 4 +- .../jboss/as/quickstart/xml/SAXXMLParser.java | 4 +- .../jboss/as/quickstart/xml/XMLParser.java | 6 +- .../quickstart/xml/upload/FileUploadBean.java | 6 +- .../xml/upload/FileUploadServlet.java | 6 +- 326 files changed, 2696 insertions(+), 2696 deletions(-) diff --git a/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/Main.java b/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/Main.java index 8ca1b8f857..8d1883a2d9 100644 --- a/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/Main.java +++ b/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/Main.java @@ -28,15 +28,15 @@ /** * A simple EJB client to demonstrate the use of the JBoss application container * to show that the injection will work for server EJB-beans. - * + * * @author Wolf-Dieter Fink */ public class Main { private static final Logger LOG = Logger.getLogger(Main.class); - + /** * Use field injection for the EJB reference.
- * Notice that the application-container injection only works for + * Notice that the application-container injection only works for * static fields within the main class of the application
* See JSR 342 (EE7 platform spec) chapter 5.2.5 . */ diff --git a/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/interceptor/ClientInterceptor.java b/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/interceptor/ClientInterceptor.java index 3a3986c031..fca7a01ca8 100644 --- a/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/interceptor/ClientInterceptor.java +++ b/app-client/client-simple/src/main/java/org/jboss/as/quickstarts/appclient/acc/client/interceptor/ClientInterceptor.java @@ -24,7 +24,7 @@ /** * Example of an interceptor at client side which can be configures with the {@link EJBClientContext#registerInterceptor(int * priority, new ClientInterceptor())}. - * + * * @author Wolf-Dieter Fink */ public class ClientInterceptor implements EJBClientInterceptor { diff --git a/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSession.java b/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSession.java index 9fec7272ed..a00a38f91b 100644 --- a/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSession.java +++ b/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSession.java @@ -28,8 +28,8 @@ public interface StatelessSession { */ public abstract void invokeWithClientContext(); /** - * - * @return a greeting string with the jboss.node.name + * + * @return a greeting string with the jboss.node.name */ public abstract String getGreeting(); } diff --git a/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSessionBean.java b/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSessionBean.java index ebdcb2c5a5..05e2208bdd 100644 --- a/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSessionBean.java +++ b/app-client/ejb/src/main/java/org/jboss/as/quickstarts/appclient/server/ejb/StatelessSessionBean.java @@ -23,9 +23,9 @@ import org.jboss.logging.Logger; /** - * Simple implementation to show the behavior of EJB clients which are started in + * Simple implementation to show the behavior of EJB clients which are started in * the application client environment. - * + * * @author Wolf-Dieter Fink */ @Stateless @@ -33,12 +33,12 @@ public class StatelessSessionBean implements StatelessSession { private static final Logger LOGGER = Logger.getLogger(StatelessSessionBean.class); @Resource SessionContext context; - + @Override public void invokeWithClientContext() { LOGGER.info("ClientContext is here = "+context.getContextData()); } - + @Override public String getGreeting() { return "Hello from StatelessSessionBean@" + System.getProperty("jboss.node.name"); diff --git a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/controller/JobData.java b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/controller/JobData.java index a8a2e87c93..1990fcf8a7 100644 --- a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/controller/JobData.java +++ b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/controller/JobData.java @@ -40,8 +40,8 @@ public class JobData { private String exitStatus; - public JobData(Long jobInstanceId, Long executionId, String jobName, - Date startTime, Date endTime, BatchStatus batchStatus, + public JobData(Long jobInstanceId, Long executionId, String jobName, + Date startTime, Date endTime, BatchStatus batchStatus, Properties parameters, String exitStatus) { this.jobInstanceId = jobInstanceId; this.executionId = executionId; diff --git a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/job/ChunkCheckpoint.java b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/job/ChunkCheckpoint.java index 43439934f1..7ffeb82010 100644 --- a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/job/ChunkCheckpoint.java +++ b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/job/ChunkCheckpoint.java @@ -1,7 +1,7 @@ /* * JBoss, Home of Professional Open Source * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the + * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,7 +9,7 @@ * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -25,7 +25,7 @@ public class ChunkCheckpoint implements Serializable { private static final long serialVersionUID = 1L; - + private long lineNumber; public void increase() { diff --git a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/util/Resources.java b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/util/Resources.java index 471713c987..8f1867f986 100644 --- a/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/util/Resources.java +++ b/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/util/Resources.java @@ -29,11 +29,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans - * + * *

* Example injection on a managed bean field: *

- * + * *
  * @Inject
  * private EntityManager em;
diff --git a/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/Address.java b/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/Address.java
index a8ee312afb..310532b9c5 100644
--- a/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/Address.java
+++ b/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/Address.java
@@ -38,4 +38,4 @@
     Class[] groups() default {};
 
     Class[] payload() default {};
-}
\ No newline at end of file
+}
diff --git a/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/AddressValidator.java b/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/AddressValidator.java
index b27737a3fd..dad6945610 100644
--- a/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/AddressValidator.java
+++ b/bean-validation-custom-constraint/src/main/java/org/jboss/as/quickstarts/bean_validation_custom_constraint/AddressValidator.java
@@ -25,9 +25,9 @@ public class AddressValidator implements ConstraintValidatorGiriraj Sharma
- * 
+ *
  */
 @RunWith(Arquillian.class)
 public class MyPersonTest {
 
     /**
      * Constructs a deployment archive
-     * 
+     *
      * @return the deployment archive
      */
     @Deployment
@@ -74,7 +74,7 @@ public static Archive createTestArchive() {
 
     /**
      * Tests an empty member registration, e.g. violation of:
-     * 
+     *
      * 
-    * 
+    *
     * @param text
     *            Simple text for logging in the target servers logfile
     * @return A text with server details for demonstration
diff --git a/ejb-multi-server/app-main/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/MainAppSContextBean.java b/ejb-multi-server/app-main/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/MainAppSContextBean.java
index 385a345131..abb84b05fc 100644
--- a/ejb-multi-server/app-main/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/MainAppSContextBean.java
+++ b/ejb-multi-server/app-main/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/MainAppSContextBean.java
@@ -42,18 +42,18 @@
  * The sub applications, deployed in different servers are called direct by
  * using the ejb-client scoped context properties.
  * 

- * + * * @author Wolf-Dieter Fink */ @Stateless public class MainAppSContextBean implements MainApp { private static final Logger LOGGER = Logger.getLogger(MainAppSContextBean.class); - + private static Integer activeInstances = 0; private static Context appOneScopedEjbContext; private static Context appTwoScopedEjbContextA; private static Context appTwoScopedEjbContextB; - + @Resource SessionContext context; @@ -70,7 +70,7 @@ private void createAppOneContext() { // In this example, we are just configuring a single connection. final String connectionName = "appOneConnection"; ejbClientContextProps.put("remote.connections", connectionName); - // add the properties to connect the app-one host + // add the properties to connect the app-one host ejbClientContextProps.put("remote.connection." + connectionName + ".host", "localhost"); ejbClientContextProps.put("remote.connection." + connectionName + ".port", "8180"); ejbClientContextProps.put("remote.connection." + connectionName + ".username", "quickuser1"); @@ -83,7 +83,7 @@ private void createAppOneContext() { appOneScopedEjbContext = (Context)new InitialContext(ejbClientContextProps).lookup("ejb:"); } catch (NamingException e) {LOGGER.error("Could not create InitialContext('appOne')", e);} } - + private void createAppTwoContext() { final Properties ejbClientContextProps = new Properties(); ejbClientContextProps.put("endpoint.name", "appMain->appTwoA_endpoint"); @@ -101,7 +101,7 @@ private void createAppTwoContext() { ejbClientContextProps.put("remote.connection." + connectionName + ".port", "8280"); ejbClientContextProps.put("remote.connection." + connectionName + ".username", "quickuser1"); ejbClientContextProps.put("remote.connection." + connectionName + ".password", "quick123+"); - + try { appTwoScopedEjbContextA = (Context) new InitialContext(ejbClientContextProps).lookup("ejb:"); } catch (NamingException e) {LOGGER.error("Could not create InitialContext('appTwoA')", e);} @@ -116,7 +116,7 @@ private void createAppTwoContext() { appTwoScopedEjbContextB = (Context) new InitialContext(ejbClientContextProps).lookup("ejb:"); } catch (NamingException e) {LOGGER.error("Could not create InitialContext('appTwoB')", e);} } - + @PostConstruct private void createScopedContext() { synchronized (activeInstances) { @@ -128,7 +128,7 @@ private void createScopedContext() { activeInstances++; } } - + @PreDestroy private void destroyScopedContext() { synchronized (activeInstances) { @@ -156,7 +156,7 @@ private void destroyScopedContext() { } } } - + @Override public String getJBossNodeName() { return System.getProperty("jboss.node.name"); @@ -186,7 +186,7 @@ public String invokeAll(String text) { * will use the 'quickuser1', to differentiate the cluster connection it * will be use the user 'quickuser2' to see if the clustered context is used * or not. - * + * * @param text * Simple text which will be logged at server side. * @return simple collection of the returned results @@ -220,7 +220,7 @@ private String invokeAppOne(String text) { /** * Close the given context and write a log message which endpoint is closed. - * + * * @param iCtx * context to close, null will be ignored. */ @@ -235,13 +235,13 @@ private static void saveContextClose(Context iCtx) { } } } - + /** * Invoke the App2 with different ejb-client context. The server AppTwoA * will be called with the user quickuser1. The server AppTwoB will be * called with the user quickuser2. Both invocations are separate, there * will no mix between. Also the outbound-connection is not used. - * + * * @param text * Simple text which will be logged at server side. * @return simple collection of the returned results @@ -263,7 +263,7 @@ private String invokeAppTwo(String text) { StringBuilder result = new StringBuilder(" appTwo loop(4 time A-B expected){"); for (int i = 0; i < 4; i++) { // invoke on the bean - String appResult = beanA.invokeSecured(text); + String appResult = beanA.invokeSecured(text); if (i > 0) { result.append(", "); } @@ -278,16 +278,16 @@ private String invokeAppTwo(String text) { return result.toString(); } - + /** * Same method as {@link #invokeAppTwo(String)}, but the scoped context is created and destroyed * inside the method. Because of this it is not possbile to use the transaction managed by the container * as the connection must be open until the container send commit/rollback to the foreign server. - * Therefore it is necessary to add the annotation @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) + * Therefore it is necessary to add the annotation @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) * to the {@link #invokeAll(String)} method. - * + * * For test you might rename this method. - * + * * @param text * Simple text which will be logged at server side. * @return simple collection of the returned results @@ -313,7 +313,7 @@ private String invokeAppTwoAlternative(String text) { ejbClientContextProps.put("remote.connection." + connectionName + ".port", "8280"); ejbClientContextProps.put("remote.connection." + connectionName + ".username", "quickuser1"); ejbClientContextProps.put("remote.connection." + connectionName + ".password", "quick123+"); - + Context iCtxA = null; try { iCtxA = (Context) new InitialContext(ejbClientContextProps).lookup("ejb:"); @@ -336,7 +336,7 @@ private String invokeAppTwoAlternative(String text) { StringBuilder result = new StringBuilder(" appTwo loop(4 time A-B expected){"); for (int i = 0; i < 4; i++) { // invoke on the bean - String appResult = beanA.invokeSecured(text); + String appResult = beanA.invokeSecured(text); if (i > 0) { result.append(", "); } @@ -357,4 +357,4 @@ private String invokeAppTwoAlternative(String text) { return result.toString(); } -} \ No newline at end of file +} diff --git a/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/EjbInvocation.java b/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/EjbInvocation.java index f4a71781f8..a561423037 100644 --- a/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/EjbInvocation.java +++ b/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/EjbInvocation.java @@ -18,7 +18,7 @@ /** * A container for the result of an EJB invocation. It will be used by the JsfController. - * + * * @author Wolf-Dieter Fink */ public class EjbInvocation { diff --git a/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/JsfController.java b/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/JsfController.java index bdd962dc80..3e96428859 100644 --- a/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/JsfController.java +++ b/ejb-multi-server/app-main/web/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/JsfController.java @@ -27,7 +27,7 @@ /** * A simple JSF controller to show how the EJB invocation on different servers. - * + * * @author Wolf-Dieter Fink */ @Model @@ -57,7 +57,7 @@ public class JsfController { * Lookup is introduced in Java EE6, so there are compiler or runtime problems if a Java version is used which not contain * the javax.annotation.Resource lookup. * Therefore a fix/workaround is necessary to be able to compile. - * See Jaikiran's technical blog + * See Jaikiran's technical blog */ @Resource(lookup = "ejb:jboss-ejb-multi-server-app-one/ejb//AppOneBean!org.jboss.as.quickstarts.ejb.multi.server.app.AppOne") AppOne oneApp; diff --git a/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOne.java b/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOne.java index 0ffb14a324..65e31119f7 100644 --- a/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOne.java +++ b/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOne.java @@ -20,7 +20,7 @@ /** * Interface for the demo application One. - * + * * @author Wolf-Dieter Fink */ @Remote @@ -28,7 +28,7 @@ public interface AppOne { /** * Unsecured invocation, will return the name of application, principal and JBoss node. - * + * * @param text Simple text written to to the logfile to identify the invocation * @return app1[<PrincipalName>]@<jboss.node.name> */ @@ -41,7 +41,7 @@ public interface AppOne { /** * Secured invocation for Roles ( AppOne, Intern ). See {@link #invoke(String)} - * + * * @param text Simple text written to to the logfile to identify the invocation * @return app1[<PrincipalName>]@<jboss.node.name> */ diff --git a/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOneBean.java b/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOneBean.java index 8649ea3542..238bdbae4a 100644 --- a/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOneBean.java +++ b/ejb-multi-server/app-one/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppOneBean.java @@ -34,11 +34,11 @@ * If the security-domain is removed the secured method can be invoked from every user. The shown principal user is 'anonymous' * instead of the original logged in user. *

- * + * *

* The EJB is marked as clustered by using the xml deployment descriptor, see jboss-ejb3.xml *

- * + * * @author Wolf-Dieter Fink */ @Stateless diff --git a/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwo.java b/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwo.java index 2cfaded9ec..975f08caca 100644 --- a/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwo.java +++ b/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwo.java @@ -20,7 +20,7 @@ /** * Interface for the demo application One. - * + * * @author Wolf-Dieter Fink */ @Remote @@ -28,7 +28,7 @@ public interface AppTwo { /** * Unsecured invocation, will return the name of application, principal and JBoss node. - * + * * @param text Simple text written to to the logfile to identify the invocation * @return app1[<PrincipalName>]@<jboss.node.name> */ @@ -41,7 +41,7 @@ public interface AppTwo { /** * Secured invocation for Roles ( AppTwo, Intern ). See {@link #invoke(String)} - * + * * @param text Simple text written to to the logfile to identify the invocation * @return app1[<PrincipalName>]@<jboss.node.name> */ diff --git a/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwoBean.java b/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwoBean.java index f7229e5b53..9222e7a0f4 100644 --- a/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwoBean.java +++ b/ejb-multi-server/app-two/ejb/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/app/AppTwoBean.java @@ -29,7 +29,7 @@ /** * Simple bean with methods to get the node name of the server and log messages. One method is annotated with a security role. * The security-domain is declared by the JBoss specific annotation SecurityDomain. - * + * * @author Wolf-Dieter Fink */ @SecurityDomain(value = "other") diff --git a/ejb-multi-server/app-web/src/main/java/org/jboss/as/quickstarts/web/multi/server/app/Servlet.java b/ejb-multi-server/app-web/src/main/java/org/jboss/as/quickstarts/web/multi/server/app/Servlet.java index 3688394660..369110ebe9 100644 --- a/ejb-multi-server/app-web/src/main/java/org/jboss/as/quickstarts/web/multi/server/app/Servlet.java +++ b/ejb-multi-server/app-web/src/main/java/org/jboss/as/quickstarts/web/multi/server/app/Servlet.java @@ -35,7 +35,7 @@ /** * A simple servlet that is used to invoke all other application EJB's. - * + * * @author Wolf-Dieter Fink */ @WebServlet(urlPatterns = "/*") diff --git a/ejb-multi-server/client/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/Client.java b/ejb-multi-server/client/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/Client.java index cb9b010ff4..c69046e0fe 100644 --- a/ejb-multi-server/client/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/Client.java +++ b/ejb-multi-server/client/src/main/java/org/jboss/as/quickstarts/ejb/multi/server/Client.java @@ -38,20 +38,20 @@ *

* With the boolean property UseScopedContext the basic example or the example with the scoped-environment will be called. *

- * + * * @author Wolf-Dieter Fink */ public class Client { /** * @param args no args needed - * @throws Exception + * @throws Exception */ public static void main(String[] args) throws Exception { // suppress output of client messages Logger.getLogger("org.jboss").setLevel(Level.OFF); Logger.getLogger("org.xnio").setLevel(Level.OFF); - + Properties p = new Properties(); p.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false"); p.put("remote.connections", "one"); diff --git a/ejb-remote/client/src/main/java/org/jboss/as/quickstarts/ejb/remote/client/RemoteEJBClient.java b/ejb-remote/client/src/main/java/org/jboss/as/quickstarts/ejb/remote/client/RemoteEJBClient.java index fc7937b5f2..3256ddb8ab 100644 --- a/ejb-remote/client/src/main/java/org/jboss/as/quickstarts/ejb/remote/client/RemoteEJBClient.java +++ b/ejb-remote/client/src/main/java/org/jboss/as/quickstarts/ejb/remote/client/RemoteEJBClient.java @@ -28,7 +28,7 @@ /** * A sample program which acts a remote client for a EJB deployed on AS7 server. This program shows how to lookup stateful and * stateless beans via JNDI and then invoke on them - * + * * @author Jaikiran Pai */ public class RemoteEJBClient { @@ -43,7 +43,7 @@ public static void main(String[] args) throws Exception { /** * Looks up a stateless bean and invokes on it - * + * * @throws NamingException */ private static void invokeStatelessBean() throws NamingException { @@ -75,7 +75,7 @@ private static void invokeStatelessBean() throws NamingException { /** * Looks up a stateful bean and invokes on it - * + * * @throws NamingException */ private static void invokeStatefulBean() throws NamingException { @@ -101,7 +101,7 @@ private static void invokeStatefulBean() throws NamingException { /** * Looks up and returns the proxy to remote stateless calculator bean - * + * * @return * @throws NamingException */ @@ -135,7 +135,7 @@ private static RemoteCalculator lookupRemoteStatelessCalculator() throws NamingE /** * Looks up and returns the proxy to remote stateful counter bean - * + * * @return * @throws NamingException */ diff --git a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/ClientSecurityInterceptor.java b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/ClientSecurityInterceptor.java index fde9be8704..9380217469 100644 --- a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/ClientSecurityInterceptor.java +++ b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/ClientSecurityInterceptor.java @@ -24,7 +24,7 @@ /** * Client side interceptor responsible for propagating the local identity. - * + * * @author Darran Lofthouse */ public class ClientSecurityInterceptor implements EJBClientInterceptor { diff --git a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/DelegationLoginModule.java b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/DelegationLoginModule.java index 7fdbd6cc08..e1de8b00c9 100644 --- a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/DelegationLoginModule.java +++ b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/DelegationLoginModule.java @@ -38,7 +38,7 @@ /** * Login module to make the decision if one user can ask for the current request to be switched to an alternative specified * user. - * + * * @author Darran Lofthouse */ public class DelegationLoginModule extends AbstractServerLoginModule { @@ -117,19 +117,19 @@ public boolean login() throws LoginException { /** * Make a trust user to decide if the user switch is acceptable. - * + * * The default implementation checks the Properties for the user that opened the connection looking for a match, the * property read is then used to check if the connection user can delegate to the user specified. - * + * * The following entries will be checked in the Properties in this order: - user@realm - This is an exact match for the user * / realm combination of the connection user. user@* - This entry allows a match by username for any realm. *@realm - This * entry allows for any user in the realm specified. * - This matches all users. - * + * * Once an entry has been found the Properties will not be read again, even if the entry loaded does not allow delegation. - * + * * The value for the property is either '*' which means delegation to any user is allowed or a comma separate list of users * that can be delegated to. - * + * * @param requestedUser - The user this request wants to be authorized as. * @param connectionUser - The use of the connection to the server. * @return true if a switch is acceptable, false otherwise. diff --git a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJB.java b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJB.java index e60cfdc2d5..68f675c9ae 100644 --- a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJB.java +++ b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJB.java @@ -26,7 +26,7 @@ /** * An EJB for testing EJB to remote EJB calls. - * + * * @author Darran Lofthouse */ @Stateless diff --git a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJBRemote.java b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJBRemote.java index c487a357f3..390ebfa1e9 100644 --- a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJBRemote.java +++ b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/IntermediateEJBRemote.java @@ -20,7 +20,7 @@ /** * The interface to the intermediate EJB used to test EJB to remote EJB calls. - * + * * @author Darran Lofthouse */ @Remote diff --git a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/RemoteClient.java b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/RemoteClient.java index 972d3d3752..504515a605 100644 --- a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/RemoteClient.java +++ b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/RemoteClient.java @@ -40,7 +40,7 @@ /** * The remote client responsible for making a number of calls to the server to demonstrate the capabilities of the interceptors. - * + * * @author Darran Lofthouse */ public class RemoteClient { diff --git a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJB.java b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJB.java index 2881a8b132..a559b198fe 100644 --- a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJB.java +++ b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJB.java @@ -26,7 +26,7 @@ /** * A secured EJB which is used to test the identity and roles of the current user during a request. - * + * * @author Darran Lofthouse */ @Stateless diff --git a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJBRemote.java b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJBRemote.java index 4264be9501..9793d3e2bc 100644 --- a/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJBRemote.java +++ b/ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors/SecuredEJBRemote.java @@ -18,7 +18,7 @@ /** * The interface used to access the SecuredEJB - * + * * @author Darran Lofthouse */ public interface SecuredEJBRemote { diff --git a/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJB.java b/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJB.java index b25652bc05..0c8c670a7a 100644 --- a/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJB.java +++ b/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJB.java @@ -27,15 +27,15 @@ /** * Simple secured EJB using EJB security annotations - * + * * @author Sherif Makary - * + * */ /** - * + * * Annotate this EJB for authorization. Allow only those in the "guest" role. For EJB authorization, you must also specify the * security domain. This example uses the "other" security domain which is provided by default in the standalone.xml file. - * + * */ @Stateless @RolesAllowed({ "guest" }) diff --git a/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJBServlet.java b/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJBServlet.java index 7badc1759a..26689abd46 100644 --- a/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJBServlet.java +++ b/ejb-security/src/main/java/org/jboss/as/quickstarts/ejb_security/SecuredEJBServlet.java @@ -32,9 +32,9 @@ /** * A simple secured Servlet which calls a secured EJB. Upon successful authentication and authorization the EJB will return the * principal's name. Servlet security is implemented using annotations. - * + * * @author Sherif Makary - * + * */ @SuppressWarnings("serial") @WebServlet("/SecuredEJBServlet") diff --git a/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterEJBLocal.java b/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterEJBLocal.java index e3ef93b757..4fa6e2775a 100644 --- a/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterEJBLocal.java +++ b/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterEJBLocal.java @@ -26,5 +26,5 @@ public interface GreeterEJBLocal { public String sayHello(String name) throws GreeterException; - + } diff --git a/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterException.java b/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterException.java index af2dedcafb..6a9298ef3c 100644 --- a/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterException.java +++ b/ejb-throws-exception/ejb-api/src/main/java/org/jboss/as/quickstarts/ear/client/GreeterException.java @@ -26,7 +26,7 @@ public class GreeterException extends Exception { private static final long serialVersionUID = 1L; /** - * + * */ public GreeterException() { } diff --git a/ejb-throws-exception/ejb/src/main/java/org/jboss/as/quickstarts/ear/ejb/GreeterEJB.java b/ejb-throws-exception/ejb/src/main/java/org/jboss/as/quickstarts/ear/ejb/GreeterEJB.java index ac0d03007e..55e07553a0 100644 --- a/ejb-throws-exception/ejb/src/main/java/org/jboss/as/quickstarts/ear/ejb/GreeterEJB.java +++ b/ejb-throws-exception/ejb/src/main/java/org/jboss/as/quickstarts/ear/ejb/GreeterEJB.java @@ -28,17 +28,17 @@ public class GreeterEJB implements GreeterEJBLocal { /** - * Default constructor. + * Default constructor. */ public GreeterEJB() { } - + public String sayHello(String name) throws GreeterException { - + if(name == null || name.equals("")) throw new GreeterException("name cannot be null or empty"); - - return "Hello " + name; + + return "Hello " + name; } } diff --git a/ejb-throws-exception/web/src/main/java/org/jboss/as/quickstarts/ear/controller/GreeterBean.java b/ejb-throws-exception/web/src/main/java/org/jboss/as/quickstarts/ear/controller/GreeterBean.java index 000bd0afbe..50b4994f0e 100644 --- a/ejb-throws-exception/web/src/main/java/org/jboss/as/quickstarts/ear/controller/GreeterBean.java +++ b/ejb-throws-exception/web/src/main/java/org/jboss/as/quickstarts/ear/controller/GreeterBean.java @@ -36,21 +36,21 @@ public class GreeterBean { /* Inject the Local interface of the GreeterEJB so we can invoke sayHello */ private @EJB GreeterEJBLocal greeterEJB; - + /* An instance variable to hold the data bound in the inputText of the JSF page */ private String name; - + /* And instance variable to hold the EJB response or exception message that is bound to the outputText on the JSF page */ private String response; - + /** - * + * */ public GreeterBean() { } - + /** - * The name getter to retrieve the name value which will be displayed in the inputText + * The name getter to retrieve the name value which will be displayed in the inputText * @return the name to be displayed in the inputText on the JSF page */ public String getName() { @@ -67,7 +67,7 @@ public void setName(String name) { /** * The response displayed on the JSF page is an outputText, so we only need a getter - * @return the value of the response variable which is set after the EJB is invoked in the sayHello action + * @return the value of the response variable which is set after the EJB is invoked in the sayHello action */ public String getResponse() { return response; @@ -78,15 +78,15 @@ public String getResponse() { * @return a string which JSF uses for page navigation, an empty string means reload the original page */ public String sayHello() { - + try { - response = greeterEJB.sayHello(name); - } + response = greeterEJB.sayHello(name); + } catch(GreeterException e) { response = "Error: " + e.getMessage(); } return ""; } - + } diff --git a/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/ScheduleExample.java b/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/ScheduleExample.java index daa2a1b1b9..fd9f776564 100644 --- a/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/ScheduleExample.java +++ b/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/ScheduleExample.java @@ -24,17 +24,17 @@ /** * Demonstrates how to use the EJB's @Schedule. - * + * * @author Ondrej Zizka */ @Singleton public class ScheduleExample { - + @Schedule(second="*/6", minute="*",hour="*", persistent=false) public void doWork(){ Date currentTime = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd G 'at' HH:mm:ss z"); System.out.println( "ScheduleExample.doWork() invoked at " + simpleDateFormat.format(currentTime) ); } - + } diff --git a/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java b/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java index caa7cd827c..f5750bd94e 100644 --- a/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java +++ b/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java @@ -27,7 +27,7 @@ /** * Demonstrates how to use the EJB's @Timeout. - * + * * @author Ondrej Zizka */ @Singleton @@ -36,14 +36,14 @@ public class TimeoutExample { @Resource private TimerService timerService; - + @Timeout public void scheduler(Timer timer) { Date currentTime = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd G 'at' HH:mm:ss z"); System.out.println("TimeoutExample.scheduler() " + timer.getInfo() + simpleDateFormat.format(currentTime)); } - + @PostConstruct public void initialize( InvocationContext ctx ) { ScheduleExpression se = new ScheduleExpression(); @@ -51,9 +51,9 @@ public void initialize( InvocationContext ctx ) { se.hour("*").minute("*").second("0/3"); timerService.createCalendarTimer( se, new TimerConfig("EJB timer service timeout at ", false) ); } - + @PreDestroy - public void stop() { + public void stop() { System.out.println("EJB Timer: Stop timers."); for (Timer timer : timerService.getTimers()) { System.out.println("Stopping timer: " + timer.getInfo()); diff --git a/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloService.java b/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloService.java index 74ddbc024a..82d0dfb66e 100644 --- a/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloService.java +++ b/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloService.java @@ -18,9 +18,9 @@ /** * A simple CDI service which is able to say hello to someone - * + * * @author Pete Muir - * + * */ public class HelloService { diff --git a/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloWorld.java b/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloWorld.java index 6fd9faf6a5..733a01e288 100644 --- a/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloWorld.java +++ b/helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloWorld.java @@ -25,7 +25,7 @@ /** * A simple REST service which is able to say hello to someone using HelloService Please take a look at the web.xml where JAX-RS * is enabled And notice the @PathParam which expects the URL to contain /json/David or /xml/Mary - * + * * @author bsutter@redhat.com */ diff --git a/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java b/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java index 211439ba40..953733b336 100644 --- a/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java +++ b/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java @@ -1,43 +1,43 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -/** - * Annotated interface. - * - * @author Jeremie Lagarde - * - */ -public interface IHelloWorldMXBean { - - /** - * Read only attribute - */ - long getCount(); - - /** - * Read write attribute - */ - void setWelcomeMessage(String message); - - String getWelcomeMessage(); - - /** - * Operation - */ - String sayHello(String name); -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +/** + * Annotated interface. + * + * @author Jeremie Lagarde + * + */ +public interface IHelloWorldMXBean { + + /** + * Read only attribute + */ + long getCount(); + + /** + * Read write attribute + */ + void setWelcomeMessage(String message); + + String getWelcomeMessage(); + + /** + * Operation + */ + String sayHello(String name); +} diff --git a/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java b/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java index 118c06751c..25e04577d5 100644 --- a/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java +++ b/helloworld-mbean/helloworld-mbean-service/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java @@ -1,61 +1,61 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.util.concurrent.atomic.AtomicLong; -import java.util.logging.Logger; - -/** - * Mbean pojo using MXBean interface and declared in jboss-service.xml. - * - * @author Jeremie Lagarde - * - */ -public class MXPojoHelloWorld implements IHelloWorldMXBean { - - private static final Logger log = Logger.getLogger(MXPojoHelloWorld.class.getName()); - - private String welcomeMessage = "Hello"; - private AtomicLong count = new AtomicLong(0); - - public long getCount() { - return count.get(); - } - - public void setWelcomeMessage(String message) { - if (message != null && message.trim().length() > 0) - welcomeMessage = message; - } - - public String getWelcomeMessage() { - return welcomeMessage; - } - - public String sayHello(String name) { - count.incrementAndGet(); - return welcomeMessage + " " + name + "!"; - } - - public void start() throws Exception { - log.info(" >> MXPojoHelloWorld.start() invoked"); - } - - public void stop() throws Exception { - log.info(" << MXPojoHelloWorld.stop() invoked"); - } - -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Logger; + +/** + * Mbean pojo using MXBean interface and declared in jboss-service.xml. + * + * @author Jeremie Lagarde + * + */ +public class MXPojoHelloWorld implements IHelloWorldMXBean { + + private static final Logger log = Logger.getLogger(MXPojoHelloWorld.class.getName()); + + private String welcomeMessage = "Hello"; + private AtomicLong count = new AtomicLong(0); + + public long getCount() { + return count.get(); + } + + public void setWelcomeMessage(String message) { + if (message != null && message.trim().length() > 0) + welcomeMessage = message; + } + + public String getWelcomeMessage() { + return welcomeMessage; + } + + public String sayHello(String name) { + count.incrementAndGet(); + return welcomeMessage + " " + name + "!"; + } + + public void start() throws Exception { + log.info(" >> MXPojoHelloWorld.start() invoked"); + } + + public void stop() throws Exception { + log.info(" << MXPojoHelloWorld.stop() invoked"); + } + +} diff --git a/helloworld-mbean/helloworld-mbean-service/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java b/helloworld-mbean/helloworld-mbean-service/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java index 4cbd501b28..a89c34c548 100644 --- a/helloworld-mbean/helloworld-mbean-service/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java +++ b/helloworld-mbean/helloworld-mbean-service/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java @@ -1,73 +1,73 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.lang.management.ManagementFactory; - -import javax.management.Attribute; -import javax.management.MBeanInfo; -import javax.management.MBeanServer; -import javax.management.ObjectName; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Testing pojo mbean with mxbean interface. - * - * @author Jeremie Lagarde - * - */ -@RunWith(Arquillian.class) -public class MXPojoHelloWorldTest { - - /** - * Constructs a deployment archive - * - * @return the deployment archive - */ - @Deployment - public static Archive createTestArchive() { - return ShrinkWrap.create(JavaArchive.class, "myservice.sar") - .addClasses(MXPojoHelloWorld.class).addClasses(IHelloWorldMXBean.class) - .addAsManifestResource("META-INF/jboss-service.xml", "jboss-service.xml"); - } - - @Test - public void testHello() throws Exception { - MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); - ObjectName objectName = new ObjectName("quickstarts", "type", "SarMXPojoHelloWorld"); - MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); - Assert.assertNotNull(mbeanInfo); - Assert.assertEquals(0L, mbeanServer.getAttribute(objectName, "Count")); - Assert.assertEquals("Welcome", mbeanServer.getAttribute(objectName, "WelcomeMessage")); - Assert.assertEquals("Welcome jer!", - mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); - Assert.assertEquals(1L, mbeanServer.getAttribute(objectName, "Count")); - mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage", "Hi")); - Assert.assertEquals("Hi jer!", - mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); - Assert.assertEquals(2L, mbeanServer.getAttribute(objectName, "Count")); - } - -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.lang.management.ManagementFactory; + +import javax.management.Attribute; +import javax.management.MBeanInfo; +import javax.management.MBeanServer; +import javax.management.ObjectName; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Testing pojo mbean with mxbean interface. + * + * @author Jeremie Lagarde + * + */ +@RunWith(Arquillian.class) +public class MXPojoHelloWorldTest { + + /** + * Constructs a deployment archive + * + * @return the deployment archive + */ + @Deployment + public static Archive createTestArchive() { + return ShrinkWrap.create(JavaArchive.class, "myservice.sar") + .addClasses(MXPojoHelloWorld.class).addClasses(IHelloWorldMXBean.class) + .addAsManifestResource("META-INF/jboss-service.xml", "jboss-service.xml"); + } + + @Test + public void testHello() throws Exception { + MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); + ObjectName objectName = new ObjectName("quickstarts", "type", "SarMXPojoHelloWorld"); + MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); + Assert.assertNotNull(mbeanInfo); + Assert.assertEquals(0L, mbeanServer.getAttribute(objectName, "Count")); + Assert.assertEquals("Welcome", mbeanServer.getAttribute(objectName, "WelcomeMessage")); + Assert.assertEquals("Welcome jer!", + mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); + Assert.assertEquals(1L, mbeanServer.getAttribute(objectName, "Count")); + mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage", "Hi")); + Assert.assertEquals("Hi jer!", + mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); + Assert.assertEquals(2L, mbeanServer.getAttribute(objectName, "Count")); + } + +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AbstractComponentMBean.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AbstractComponentMBean.java index 7492d09c05..722385b179 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AbstractComponentMBean.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AbstractComponentMBean.java @@ -1,71 +1,71 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.lang.management.ManagementFactory; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.management.MBeanServer; -import javax.management.ObjectName; - -/** - * Abstract component class to register it as mbean. - * - * @author Jeremie Lagarde - * - */ -public abstract class AbstractComponentMBean { - - private static final Logger log = Logger.getLogger(AbstractComponentMBean.class.getName()); - - private final String domain; - private String name; - private MBeanServer mbeanServer; - private ObjectName objectName = null; - - public AbstractComponentMBean(String domain) { - super(); - this.domain = domain; - } - - @PostConstruct - protected void startup() { - this.name = this.getClass().getSimpleName(); - try { - objectName = new ObjectName(domain, "type", name); - mbeanServer = ManagementFactory.getPlatformMBeanServer(); - mbeanServer.registerMBean(this, objectName); - } catch (Exception e) { - throw new IllegalStateException("Error during registration of " - + name + " into JMX:" + e, e); - } - } - - @PreDestroy - protected void destroy() { - log.info("# << -- Destroy : " + this.name); - try { - mbeanServer.unregisterMBean(this.objectName); - } catch (Exception e) { - throw new IllegalStateException("Error during unregistration of " - + name + " into JMX:" + e, e); - } - } - -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.lang.management.ManagementFactory; +import java.util.logging.Logger; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.management.MBeanServer; +import javax.management.ObjectName; + +/** + * Abstract component class to register it as mbean. + * + * @author Jeremie Lagarde + * + */ +public abstract class AbstractComponentMBean { + + private static final Logger log = Logger.getLogger(AbstractComponentMBean.class.getName()); + + private final String domain; + private String name; + private MBeanServer mbeanServer; + private ObjectName objectName = null; + + public AbstractComponentMBean(String domain) { + super(); + this.domain = domain; + } + + @PostConstruct + protected void startup() { + this.name = this.getClass().getSimpleName(); + try { + objectName = new ObjectName(domain, "type", name); + mbeanServer = ManagementFactory.getPlatformMBeanServer(); + mbeanServer.registerMBean(this, objectName); + } catch (Exception e) { + throw new IllegalStateException("Error during registration of " + + name + " into JMX:" + e, e); + } + } + + @PreDestroy + protected void destroy() { + log.info("# << -- Destroy : " + this.name); + try { + mbeanServer.unregisterMBean(this.objectName); + } catch (Exception e) { + throw new IllegalStateException("Error during unregistration of " + + name + " into JMX:" + e, e); + } + } + +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorld.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorld.java index df5fc51ab3..478b88aec0 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorld.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorld.java @@ -1,69 +1,69 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.util.concurrent.atomic.AtomicLong; - -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.inject.Inject; - -import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; - -/** - * Mbean component using .@MXBean annotation. - * - * @author Jeremie Lagarde - * - */ -@Singleton -@Startup -public class AnnotatedComponentHelloWorld extends AbstractComponentMBean implements IAnnotatedHelloWorldMBean { - - private String welcomeMessage = "Hello"; - private AtomicLong count = new AtomicLong(0); - - @Inject - HelloService helloService; - - public AnnotatedComponentHelloWorld() { - super("quickstarts"); - } - - @Override - public long getCount() { - return count.get(); - } - - @Override - public void setWelcomeMessage(String message) { - if (message != null && message.trim().length() > 0) - welcomeMessage = message; - } - - @Override - public String getWelcomeMessage() { - return welcomeMessage; - } - - @Override - public String sayHello(String name) { - count.incrementAndGet(); - return helloService.createHelloMessage(welcomeMessage, name); - } - -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.util.concurrent.atomic.AtomicLong; + +import javax.ejb.Singleton; +import javax.ejb.Startup; +import javax.inject.Inject; + +import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; + +/** + * Mbean component using .@MXBean annotation. + * + * @author Jeremie Lagarde + * + */ +@Singleton +@Startup +public class AnnotatedComponentHelloWorld extends AbstractComponentMBean implements IAnnotatedHelloWorldMBean { + + private String welcomeMessage = "Hello"; + private AtomicLong count = new AtomicLong(0); + + @Inject + HelloService helloService; + + public AnnotatedComponentHelloWorld() { + super("quickstarts"); + } + + @Override + public long getCount() { + return count.get(); + } + + @Override + public void setWelcomeMessage(String message) { + if (message != null && message.trim().length() > 0) + welcomeMessage = message; + } + + @Override + public String getWelcomeMessage() { + return welcomeMessage; + } + + @Override + public String sayHello(String name) { + count.incrementAndGet(); + return helloService.createHelloMessage(welcomeMessage, name); + } + +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IAnnotatedHelloWorldMBean.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IAnnotatedHelloWorldMBean.java index 2a18078eeb..e7b4014457 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IAnnotatedHelloWorldMBean.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IAnnotatedHelloWorldMBean.java @@ -1,45 +1,45 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import javax.management.MXBean; - -/** - * Annotated interface. - * - * @author Jeremie Lagarde - * - */ -@MXBean -public interface IAnnotatedHelloWorldMBean { - - /** - * Read only attribute - */ - long getCount(); - - /** - * Read write attribute - */ - void setWelcomeMessage(String message); - String getWelcomeMessage(); - - /** - * Operation - */ - String sayHello(String name); -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import javax.management.MXBean; + +/** + * Annotated interface. + * + * @author Jeremie Lagarde + * + */ +@MXBean +public interface IAnnotatedHelloWorldMBean { + + /** + * Read only attribute + */ + long getCount(); + + /** + * Read write attribute + */ + void setWelcomeMessage(String message); + String getWelcomeMessage(); + + /** + * Operation + */ + String sayHello(String name); +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java index 8c67e510c2..b910ccf996 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/IHelloWorldMXBean.java @@ -1,43 +1,43 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -/** - * Annotated interface. - * - * @author Jeremie Lagarde - * - */ -public interface IHelloWorldMXBean { - - /** - * Read only attribute - */ - long getCount(); - - /** - * Read write attribute - */ - void setWelcomeMessage(String message); - String getWelcomeMessage(); - - /** - * Operation - */ - String sayHello(String name); - -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +/** + * Annotated interface. + * + * @author Jeremie Lagarde + * + */ +public interface IHelloWorldMXBean { + + /** + * Read only attribute + */ + long getCount(); + + /** + * Read write attribute + */ + void setWelcomeMessage(String message); + String getWelcomeMessage(); + + /** + * Operation + */ + String sayHello(String name); + +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorld.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorld.java index d768252e81..5af7d4360a 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorld.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorld.java @@ -1,69 +1,69 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.util.concurrent.atomic.AtomicLong; - -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.inject.Inject; - -import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; - -/** - * Mbean component using .MXBean interface. - * - * @author Jeremie Lagarde - * - */ -@Singleton -@Startup -public class MXComponentHelloWorld extends AbstractComponentMBean implements IHelloWorldMXBean { - - private String welcomeMessage = "Hello"; - private AtomicLong count = new AtomicLong(0); - - @Inject - HelloService helloService; - - public MXComponentHelloWorld() { - super("quickstarts"); - } - - @Override - public long getCount() { - return count.get(); - } - - @Override - public void setWelcomeMessage(String message) { - if (message != null && message.trim().length() > 0) - welcomeMessage = message; - } - - @Override - public String getWelcomeMessage() { - return welcomeMessage; - } - - @Override - public String sayHello(String name) { - count.incrementAndGet(); - return helloService.createHelloMessage(welcomeMessage, name); - } - -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.util.concurrent.atomic.AtomicLong; + +import javax.ejb.Singleton; +import javax.ejb.Startup; +import javax.inject.Inject; + +import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; + +/** + * Mbean component using .MXBean interface. + * + * @author Jeremie Lagarde + * + */ +@Singleton +@Startup +public class MXComponentHelloWorld extends AbstractComponentMBean implements IHelloWorldMXBean { + + private String welcomeMessage = "Hello"; + private AtomicLong count = new AtomicLong(0); + + @Inject + HelloService helloService; + + public MXComponentHelloWorld() { + super("quickstarts"); + } + + @Override + public long getCount() { + return count.get(); + } + + @Override + public void setWelcomeMessage(String message) { + if (message != null && message.trim().length() > 0) + welcomeMessage = message; + } + + @Override + public String getWelcomeMessage() { + return welcomeMessage; + } + + @Override + public String sayHello(String name) { + count.incrementAndGet(); + return helloService.createHelloMessage(welcomeMessage, name); + } + +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java index e91e0da0e3..905bf68d7f 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorld.java @@ -1,57 +1,57 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.util.concurrent.atomic.AtomicLong; - -import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; -import org.jboss.as.quickstarts.mbeanhelloworld.util.CDIExtension; - -/** - * Mbean pojo using MXBean interface and declared in jboss-service.xml. - * - * @author Jeremie Lagarde - * - */ -public class MXPojoHelloWorld implements IHelloWorldMXBean { - - private String welcomeMessage = "Hello"; - private AtomicLong count = new AtomicLong(0); - - @Override - public long getCount() { - return count.get(); - } - - @Override - public void setWelcomeMessage(String message) { - if (message != null && message.trim().length() > 0) - welcomeMessage = message; - } - - @Override - public String getWelcomeMessage() { - return welcomeMessage; - } - - @Override - public String sayHello(String name) { - count.incrementAndGet(); - HelloService helloService = CDIExtension.getBean(HelloService.class); - return helloService.createHelloMessage(welcomeMessage, name); - } -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.util.concurrent.atomic.AtomicLong; + +import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; +import org.jboss.as.quickstarts.mbeanhelloworld.util.CDIExtension; + +/** + * Mbean pojo using MXBean interface and declared in jboss-service.xml. + * + * @author Jeremie Lagarde + * + */ +public class MXPojoHelloWorld implements IHelloWorldMXBean { + + private String welcomeMessage = "Hello"; + private AtomicLong count = new AtomicLong(0); + + @Override + public long getCount() { + return count.get(); + } + + @Override + public void setWelcomeMessage(String message) { + if (message != null && message.trim().length() > 0) + welcomeMessage = message; + } + + @Override + public String getWelcomeMessage() { + return welcomeMessage; + } + + @Override + public String sayHello(String name) { + count.incrementAndGet(); + HelloService helloService = CDIExtension.getBean(HelloService.class); + return helloService.createHelloMessage(welcomeMessage, name); + } +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/service/HelloService.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/service/HelloService.java index fe28aabda0..44d7938c3d 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/service/HelloService.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/service/HelloService.java @@ -1,30 +1,30 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.service; - -/** - * A simple CDI service which is able to say hello to someone - * - * @author Jeremie Lagarde - * - */ -public class HelloService { - - public String createHelloMessage(String welcome, String name) { - return welcome + " " + name + "!"; - } -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.service; + +/** + * A simple CDI service which is able to say hello to someone + * + * @author Jeremie Lagarde + * + */ +public class HelloService { + + public String createHelloMessage(String welcome, String name) { + return welcome + " " + name + "!"; + } +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/util/CDIExtension.java b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/util/CDIExtension.java index 99b27c2a3f..2415d2550c 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/util/CDIExtension.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/main/java/org/jboss/as/quickstarts/mbeanhelloworld/util/CDIExtension.java @@ -25,9 +25,9 @@ /** * A CDI Extension to retrieve bean in a non-CDI context. - * + * * @author Jeremie Lagarde - * + * */ public class CDIExtension implements Extension { diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorldTest.java b/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorldTest.java index 121c8534e0..ad438c6686 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorldTest.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/AnnotatedComponentHelloWorldTest.java @@ -1,74 +1,74 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.lang.management.ManagementFactory; - -import javax.management.Attribute; -import javax.management.MBeanInfo; -import javax.management.MBeanServer; -import javax.management.ObjectName; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Testing annotated component mbean. - * - * @author Jeremie Lagarde - * - */ -@RunWith(Arquillian.class) -public class AnnotatedComponentHelloWorldTest { - - /** - * Constructs a deployment archive - * - * @return the deployment archive - */ - @Deployment - public static Archive createTestArchive() { - return ShrinkWrap.create(JavaArchive.class,"helloworld.jar") - .addClasses(AnnotatedComponentHelloWorld.class).addClasses(AbstractComponentMBean.class) - .addClass(IAnnotatedHelloWorldMBean.class) - .addClass(HelloService.class) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); - } - - @Test - public void testHello() throws Exception { - MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); - ObjectName objectName = new ObjectName("quickstarts", "type", AnnotatedComponentHelloWorld.class.getSimpleName()); - MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); - Assert.assertNotNull(mbeanInfo); - Assert.assertEquals(0L,mbeanServer.getAttribute(objectName, "Count")); - Assert.assertEquals("Hello",mbeanServer.getAttribute(objectName, "WelcomeMessage")); - Assert.assertEquals("Hello jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); - Assert.assertEquals(1L,mbeanServer.getAttribute(objectName, "Count")); - mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage","Hi")); - Assert.assertEquals("Hi jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); - Assert.assertEquals(2L,mbeanServer.getAttribute(objectName, "Count")); - } -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.lang.management.ManagementFactory; + +import javax.management.Attribute; +import javax.management.MBeanInfo; +import javax.management.MBeanServer; +import javax.management.ObjectName; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Testing annotated component mbean. + * + * @author Jeremie Lagarde + * + */ +@RunWith(Arquillian.class) +public class AnnotatedComponentHelloWorldTest { + + /** + * Constructs a deployment archive + * + * @return the deployment archive + */ + @Deployment + public static Archive createTestArchive() { + return ShrinkWrap.create(JavaArchive.class,"helloworld.jar") + .addClasses(AnnotatedComponentHelloWorld.class).addClasses(AbstractComponentMBean.class) + .addClass(IAnnotatedHelloWorldMBean.class) + .addClass(HelloService.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Test + public void testHello() throws Exception { + MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); + ObjectName objectName = new ObjectName("quickstarts", "type", AnnotatedComponentHelloWorld.class.getSimpleName()); + MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); + Assert.assertNotNull(mbeanInfo); + Assert.assertEquals(0L,mbeanServer.getAttribute(objectName, "Count")); + Assert.assertEquals("Hello",mbeanServer.getAttribute(objectName, "WelcomeMessage")); + Assert.assertEquals("Hello jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); + Assert.assertEquals(1L,mbeanServer.getAttribute(objectName, "Count")); + mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage","Hi")); + Assert.assertEquals("Hi jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); + Assert.assertEquals(2L,mbeanServer.getAttribute(objectName, "Count")); + } +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorldTest.java b/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorldTest.java index a24a2e1dc8..a64b07a066 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorldTest.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXComponentHelloWorldTest.java @@ -1,76 +1,76 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.lang.management.ManagementFactory; - -import javax.management.Attribute; -import javax.management.MBeanInfo; -import javax.management.MBeanServer; -import javax.management.ObjectName; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Testing component mbean with mxbean interface. - * - * @author Jeremie Lagarde - * - */ -@RunWith(Arquillian.class) -public class MXComponentHelloWorldTest { - - /** - * Constructs a deployment archive - * - * @return the deployment archive - */ - @Deployment - public static Archive createTestArchive() { - return ShrinkWrap.create(JavaArchive.class, "helloworld.jar") - .addClasses(MXComponentHelloWorld.class).addClasses(AbstractComponentMBean.class) - .addClass(IHelloWorldMXBean.class) - .addClass(HelloService.class) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); - } - - @Test - public void testHello() throws Exception { - MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); - ObjectName objectName = new ObjectName("quickstarts", "type", MXComponentHelloWorld.class.getSimpleName()); - MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); - Assert.assertNotNull(mbeanInfo); - Assert.assertEquals(0L, mbeanServer.getAttribute(objectName, "Count")); - Assert.assertEquals("Hello", mbeanServer.getAttribute(objectName, "WelcomeMessage")); - Assert.assertEquals("Hello jer!", - mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); - Assert.assertEquals(1L, mbeanServer.getAttribute(objectName, "Count")); - mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage", "Hi")); - Assert.assertEquals("Hi jer!", - mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); - Assert.assertEquals(2L, mbeanServer.getAttribute(objectName, "Count")); - } -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.lang.management.ManagementFactory; + +import javax.management.Attribute; +import javax.management.MBeanInfo; +import javax.management.MBeanServer; +import javax.management.ObjectName; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Testing component mbean with mxbean interface. + * + * @author Jeremie Lagarde + * + */ +@RunWith(Arquillian.class) +public class MXComponentHelloWorldTest { + + /** + * Constructs a deployment archive + * + * @return the deployment archive + */ + @Deployment + public static Archive createTestArchive() { + return ShrinkWrap.create(JavaArchive.class, "helloworld.jar") + .addClasses(MXComponentHelloWorld.class).addClasses(AbstractComponentMBean.class) + .addClass(IHelloWorldMXBean.class) + .addClass(HelloService.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Test + public void testHello() throws Exception { + MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); + ObjectName objectName = new ObjectName("quickstarts", "type", MXComponentHelloWorld.class.getSimpleName()); + MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); + Assert.assertNotNull(mbeanInfo); + Assert.assertEquals(0L, mbeanServer.getAttribute(objectName, "Count")); + Assert.assertEquals("Hello", mbeanServer.getAttribute(objectName, "WelcomeMessage")); + Assert.assertEquals("Hello jer!", + mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); + Assert.assertEquals(1L, mbeanServer.getAttribute(objectName, "Count")); + mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage", "Hi")); + Assert.assertEquals("Hi jer!", + mbeanServer.invoke(objectName, "sayHello", new Object[] { "jer" }, new String[] { "java.lang.String" })); + Assert.assertEquals(2L, mbeanServer.getAttribute(objectName, "Count")); + } +} diff --git a/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java b/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java index 950f58b3e7..72d760255b 100644 --- a/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java +++ b/helloworld-mbean/helloworld-mbean-webapp/src/test/java/org/jboss/as/quickstarts/mbeanhelloworld/mbean/MXPojoHelloWorldTest.java @@ -1,79 +1,79 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mbeanhelloworld.mbean; - -import java.io.File; -import java.lang.management.ManagementFactory; - -import javax.enterprise.inject.spi.Extension; -import javax.management.Attribute; -import javax.management.MBeanInfo; -import javax.management.MBeanServer; -import javax.management.ObjectName; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; -import org.jboss.as.quickstarts.mbeanhelloworld.util.CDIExtension; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Testing pojo mbean with mxbean interface. - * - * @author Jeremie Lagarde - * - */ -@RunWith(Arquillian.class) -public class MXPojoHelloWorldTest { - - private static final String WEBAPP_SRC = "src/main/webapp"; - - /** - * Constructs a deployment archive - * - * @return the deployment archive - */ - @Deployment - public static Archive createTestArchive() { - return ShrinkWrap.create(WebArchive.class,"test.war") - .addClasses(MXPojoHelloWorld.class, IHelloWorldMXBean.class, HelloService.class, CDIExtension.class) - .addAsManifestResource(new File(WEBAPP_SRC, "META-INF/jboss-service.xml"), "jboss-service.xml") - .addAsServiceProvider(Extension.class, CDIExtension.class) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); - } - - @Test - public void testHello() throws Exception { - MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); - ObjectName objectName = new ObjectName("quickstarts", "type", MXPojoHelloWorld.class.getSimpleName()); - MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); - Assert.assertNotNull(mbeanInfo); - Assert.assertEquals(0L,mbeanServer.getAttribute(objectName, "Count")); - Assert.assertEquals("Welcome",mbeanServer.getAttribute(objectName, "WelcomeMessage")); - Assert.assertEquals("Welcome jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); - Assert.assertEquals(1L,mbeanServer.getAttribute(objectName, "Count")); - mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage","Hi")); - Assert.assertEquals("Hi jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); - Assert.assertEquals(2L,mbeanServer.getAttribute(objectName, "Count")); - } -} \ No newline at end of file +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mbeanhelloworld.mbean; + +import java.io.File; +import java.lang.management.ManagementFactory; + +import javax.enterprise.inject.spi.Extension; +import javax.management.Attribute; +import javax.management.MBeanInfo; +import javax.management.MBeanServer; +import javax.management.ObjectName; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.as.quickstarts.mbeanhelloworld.service.HelloService; +import org.jboss.as.quickstarts.mbeanhelloworld.util.CDIExtension; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Testing pojo mbean with mxbean interface. + * + * @author Jeremie Lagarde + * + */ +@RunWith(Arquillian.class) +public class MXPojoHelloWorldTest { + + private static final String WEBAPP_SRC = "src/main/webapp"; + + /** + * Constructs a deployment archive + * + * @return the deployment archive + */ + @Deployment + public static Archive createTestArchive() { + return ShrinkWrap.create(WebArchive.class,"test.war") + .addClasses(MXPojoHelloWorld.class, IHelloWorldMXBean.class, HelloService.class, CDIExtension.class) + .addAsManifestResource(new File(WEBAPP_SRC, "META-INF/jboss-service.xml"), "jboss-service.xml") + .addAsServiceProvider(Extension.class, CDIExtension.class) + .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Test + public void testHello() throws Exception { + MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); + ObjectName objectName = new ObjectName("quickstarts", "type", MXPojoHelloWorld.class.getSimpleName()); + MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); + Assert.assertNotNull(mbeanInfo); + Assert.assertEquals(0L,mbeanServer.getAttribute(objectName, "Count")); + Assert.assertEquals("Welcome",mbeanServer.getAttribute(objectName, "WelcomeMessage")); + Assert.assertEquals("Welcome jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); + Assert.assertEquals(1L,mbeanServer.getAttribute(objectName, "Count")); + mbeanServer.setAttribute(objectName, new Attribute("WelcomeMessage","Hi")); + Assert.assertEquals("Hi jer!",mbeanServer.invoke(objectName, "sayHello", new Object[] {"jer"}, new String[] {"java.lang.String"})); + Assert.assertEquals(2L,mbeanServer.getAttribute(objectName, "Count")); + } +} diff --git a/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java b/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java index 9362ba2b7e..ebc931a0b4 100644 --- a/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java +++ b/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java @@ -28,9 +28,9 @@ *

* A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the queue. *

- * + * * @author Serge Pagop (spagop@redhat.com) - * + * */ @MessageDriven(name = "HelloWorldQueueMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "queue/HELLOWORLDMDBQueue"), @@ -56,4 +56,4 @@ public void onMessage(Message rcvMessage) { throw new RuntimeException(e); } } -} \ No newline at end of file +} diff --git a/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java b/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java index d8b26bc7a0..86504bac56 100644 --- a/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java +++ b/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java @@ -28,9 +28,9 @@ *

* A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the topic. *

- * + * * @author Serge Pagop (spagop@redhat.com) - * + * */ @MessageDriven(name = "HelloWorldQTopicMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "topic/HELLOWORLDMDBTopic"), @@ -56,4 +56,4 @@ public void onMessage(Message rcvMessage) { throw new RuntimeException(e); } } -} \ No newline at end of file +} diff --git a/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java b/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java index 816f97e130..42f14c9c06 100644 --- a/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java +++ b/helloworld-mdb-propertysubstitution/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java @@ -1,111 +1,111 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.servlet; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.annotation.Resource; -import javax.inject.Inject; -import javax.jms.Destination; -import javax.jms.JMSContext; -import javax.jms.JMSDestinationDefinition; -import javax.jms.JMSDestinationDefinitions; -import javax.jms.Queue; -import javax.jms.Topic; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Definition of the two JMS destinations used by the quickstart - * (one queue and one topic). - */ -@JMSDestinationDefinitions( - value = { - @JMSDestinationDefinition( - name = "java:/queue/HELLOWORLDMDBQueue", - interfaceName = "javax.jms.Queue", - destinationName = "HelloWorldMDBQueue" - ), - @JMSDestinationDefinition( - name = "java:/topic/HELLOWORLDMDBTopic", - interfaceName = "javax.jms.Topic", - destinationName = "HelloWorldMDBTopic" - ) - } -) - -/** - *

- * A simple servlet 3 as client that sends several messages to a queue or a topic. - *

- * - *

- * The servlet is registered and mapped to /HelloWorldMDBServletClient using the {@linkplain WebServlet - * @HttpServlet}. - *

- * - * @author Serge Pagop (spagop@redhat.com) - * - */ -@WebServlet("/HelloWorldMDBServletClient") -public class HelloWorldMDBServletClient extends HttpServlet { - - private static final long serialVersionUID = -8314035702649252239L; - - private static final int MSG_COUNT = 5; - - @Inject - private JMSContext context; - - @Resource(lookup = "java:/queue/HELLOWORLDMDBQueue") - private Queue queue; - - @Resource(lookup = "java:/topic/HELLOWORLDMDBTopic") - private Topic topic; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/html"); - PrintWriter out = resp.getWriter(); - out.write("

Quickstart: Example demonstrates the use of JMS 2.0 and EJB 3.2 Message-Driven Bean in JBoss EAP.

"); - try { - boolean useTopic = req.getParameterMap().keySet().contains("topic"); - final Destination destination = useTopic ? topic : queue; - - out.write("

Sending messages to " + destination + "

"); - out.write("

Following messages will be send to the destination:

"); - for (int i = 0; i < MSG_COUNT; i++) { - String text = "This is message " + (i + 1); - context.createProducer().send(destination, text); - out.write("Message (" + i + "): " + text + "
"); - } - out.write("

Go to your JBoss EAP Server console or Server log to see the result of messages processing

"); - } finally { - if (out != null) { - out.close(); - } - } - } - - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - doGet(req, resp); - } -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.servlet; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.annotation.Resource; +import javax.inject.Inject; +import javax.jms.Destination; +import javax.jms.JMSContext; +import javax.jms.JMSDestinationDefinition; +import javax.jms.JMSDestinationDefinitions; +import javax.jms.Queue; +import javax.jms.Topic; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Definition of the two JMS destinations used by the quickstart + * (one queue and one topic). + */ +@JMSDestinationDefinitions( + value = { + @JMSDestinationDefinition( + name = "java:/queue/HELLOWORLDMDBQueue", + interfaceName = "javax.jms.Queue", + destinationName = "HelloWorldMDBQueue" + ), + @JMSDestinationDefinition( + name = "java:/topic/HELLOWORLDMDBTopic", + interfaceName = "javax.jms.Topic", + destinationName = "HelloWorldMDBTopic" + ) + } +) + +/** + *

+ * A simple servlet 3 as client that sends several messages to a queue or a topic. + *

+ * + *

+ * The servlet is registered and mapped to /HelloWorldMDBServletClient using the {@linkplain WebServlet + * @HttpServlet}. + *

+ * + * @author Serge Pagop (spagop@redhat.com) + * + */ +@WebServlet("/HelloWorldMDBServletClient") +public class HelloWorldMDBServletClient extends HttpServlet { + + private static final long serialVersionUID = -8314035702649252239L; + + private static final int MSG_COUNT = 5; + + @Inject + private JMSContext context; + + @Resource(lookup = "java:/queue/HELLOWORLDMDBQueue") + private Queue queue; + + @Resource(lookup = "java:/topic/HELLOWORLDMDBTopic") + private Topic topic; + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + resp.setContentType("text/html"); + PrintWriter out = resp.getWriter(); + out.write("

Quickstart: Example demonstrates the use of JMS 2.0 and EJB 3.2 Message-Driven Bean in JBoss EAP.

"); + try { + boolean useTopic = req.getParameterMap().keySet().contains("topic"); + final Destination destination = useTopic ? topic : queue; + + out.write("

Sending messages to " + destination + "

"); + out.write("

Following messages will be send to the destination:

"); + for (int i = 0; i < MSG_COUNT; i++) { + String text = "This is message " + (i + 1); + context.createProducer().send(destination, text); + out.write("Message (" + i + "): " + text + "
"); + } + out.write("

Go to your JBoss EAP Server console or Server log to see the result of messages processing

"); + } finally { + if (out != null) { + out.close(); + } + } + } + + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + doGet(req, resp); + } +} diff --git a/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java b/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java index b224c726ed..ebc931a0b4 100644 --- a/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java +++ b/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java @@ -28,9 +28,9 @@ *

* A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the queue. *

- * + * * @author Serge Pagop (spagop@redhat.com) - * + * */ @MessageDriven(name = "HelloWorldQueueMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "queue/HELLOWORLDMDBQueue"), diff --git a/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java b/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java index 49b1ff31ee..86504bac56 100644 --- a/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java +++ b/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java @@ -28,9 +28,9 @@ *

* A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the topic. *

- * + * * @author Serge Pagop (spagop@redhat.com) - * + * */ @MessageDriven(name = "HelloWorldQTopicMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "topic/HELLOWORLDMDBTopic"), diff --git a/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java b/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java index 816f97e130..42f14c9c06 100644 --- a/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java +++ b/helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java @@ -1,111 +1,111 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.servlet; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.annotation.Resource; -import javax.inject.Inject; -import javax.jms.Destination; -import javax.jms.JMSContext; -import javax.jms.JMSDestinationDefinition; -import javax.jms.JMSDestinationDefinitions; -import javax.jms.Queue; -import javax.jms.Topic; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Definition of the two JMS destinations used by the quickstart - * (one queue and one topic). - */ -@JMSDestinationDefinitions( - value = { - @JMSDestinationDefinition( - name = "java:/queue/HELLOWORLDMDBQueue", - interfaceName = "javax.jms.Queue", - destinationName = "HelloWorldMDBQueue" - ), - @JMSDestinationDefinition( - name = "java:/topic/HELLOWORLDMDBTopic", - interfaceName = "javax.jms.Topic", - destinationName = "HelloWorldMDBTopic" - ) - } -) - -/** - *

- * A simple servlet 3 as client that sends several messages to a queue or a topic. - *

- * - *

- * The servlet is registered and mapped to /HelloWorldMDBServletClient using the {@linkplain WebServlet - * @HttpServlet}. - *

- * - * @author Serge Pagop (spagop@redhat.com) - * - */ -@WebServlet("/HelloWorldMDBServletClient") -public class HelloWorldMDBServletClient extends HttpServlet { - - private static final long serialVersionUID = -8314035702649252239L; - - private static final int MSG_COUNT = 5; - - @Inject - private JMSContext context; - - @Resource(lookup = "java:/queue/HELLOWORLDMDBQueue") - private Queue queue; - - @Resource(lookup = "java:/topic/HELLOWORLDMDBTopic") - private Topic topic; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/html"); - PrintWriter out = resp.getWriter(); - out.write("

Quickstart: Example demonstrates the use of JMS 2.0 and EJB 3.2 Message-Driven Bean in JBoss EAP.

"); - try { - boolean useTopic = req.getParameterMap().keySet().contains("topic"); - final Destination destination = useTopic ? topic : queue; - - out.write("

Sending messages to " + destination + "

"); - out.write("

Following messages will be send to the destination:

"); - for (int i = 0; i < MSG_COUNT; i++) { - String text = "This is message " + (i + 1); - context.createProducer().send(destination, text); - out.write("Message (" + i + "): " + text + "
"); - } - out.write("

Go to your JBoss EAP Server console or Server log to see the result of messages processing

"); - } finally { - if (out != null) { - out.close(); - } - } - } - - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - doGet(req, resp); - } -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.servlet; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.annotation.Resource; +import javax.inject.Inject; +import javax.jms.Destination; +import javax.jms.JMSContext; +import javax.jms.JMSDestinationDefinition; +import javax.jms.JMSDestinationDefinitions; +import javax.jms.Queue; +import javax.jms.Topic; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Definition of the two JMS destinations used by the quickstart + * (one queue and one topic). + */ +@JMSDestinationDefinitions( + value = { + @JMSDestinationDefinition( + name = "java:/queue/HELLOWORLDMDBQueue", + interfaceName = "javax.jms.Queue", + destinationName = "HelloWorldMDBQueue" + ), + @JMSDestinationDefinition( + name = "java:/topic/HELLOWORLDMDBTopic", + interfaceName = "javax.jms.Topic", + destinationName = "HelloWorldMDBTopic" + ) + } +) + +/** + *

+ * A simple servlet 3 as client that sends several messages to a queue or a topic. + *

+ * + *

+ * The servlet is registered and mapped to /HelloWorldMDBServletClient using the {@linkplain WebServlet + * @HttpServlet}. + *

+ * + * @author Serge Pagop (spagop@redhat.com) + * + */ +@WebServlet("/HelloWorldMDBServletClient") +public class HelloWorldMDBServletClient extends HttpServlet { + + private static final long serialVersionUID = -8314035702649252239L; + + private static final int MSG_COUNT = 5; + + @Inject + private JMSContext context; + + @Resource(lookup = "java:/queue/HELLOWORLDMDBQueue") + private Queue queue; + + @Resource(lookup = "java:/topic/HELLOWORLDMDBTopic") + private Topic topic; + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + resp.setContentType("text/html"); + PrintWriter out = resp.getWriter(); + out.write("

Quickstart: Example demonstrates the use of JMS 2.0 and EJB 3.2 Message-Driven Bean in JBoss EAP.

"); + try { + boolean useTopic = req.getParameterMap().keySet().contains("topic"); + final Destination destination = useTopic ? topic : queue; + + out.write("

Sending messages to " + destination + "

"); + out.write("

Following messages will be send to the destination:

"); + for (int i = 0; i < MSG_COUNT; i++) { + String text = "This is message " + (i + 1); + context.createProducer().send(destination, text); + out.write("Message (" + i + "): " + text + "
"); + } + out.write("

Go to your JBoss EAP Server console or Server log to see the result of messages processing

"); + } finally { + if (out != null) { + out.close(); + } + } + } + + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + doGet(req, resp); + } +} diff --git a/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloService.java b/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloService.java index f084850d31..c60f826617 100644 --- a/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloService.java +++ b/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloService.java @@ -18,9 +18,9 @@ /** * A simple CDI service which is able to say hello to someone - * + * * @author Pete Muir - * + * */ public class HelloService { diff --git a/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloWorld.java b/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloWorld.java index 816402849b..3fbbf4b206 100644 --- a/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloWorld.java +++ b/helloworld-rs/src/main/java/org/jboss/as/quickstarts/rshelloworld/HelloWorld.java @@ -24,9 +24,9 @@ /** * A simple REST service which is able to say hello to someone using HelloService Please take a look at the web.xml where JAX-RS * is enabled - * + * * @author gbrey@redhat.com - * + * */ @Path("/") diff --git a/helloworld-singleton/src/main/java/org/jboss/as/quickstarts/singleton/Counter.java b/helloworld-singleton/src/main/java/org/jboss/as/quickstarts/singleton/Counter.java index 239d05a3ff..e99633131a 100644 --- a/helloworld-singleton/src/main/java/org/jboss/as/quickstarts/singleton/Counter.java +++ b/helloworld-singleton/src/main/java/org/jboss/as/quickstarts/singleton/Counter.java @@ -21,9 +21,9 @@ /** * This singleton stores stores two counters which are only reset when the application is restarted. - * + * * @author Serge Pagop (spagop@redhat.com) - * + * */ @Singleton @Named diff --git a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java b/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java index 03a1f02aed..b2cfb36776 100644 --- a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java +++ b/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java @@ -23,7 +23,7 @@ /** * A simple example of how to setup a JAX-WS Web Service. It can say hello to everyone or to someone in particular. - * + * * @author lnewson@redhat.com */ @@ -32,7 +32,7 @@ public interface HelloWorldService { /** * Say hello as a response - * + * * @return A simple hello world message */ @WebMethod @@ -40,7 +40,7 @@ public interface HelloWorldService { /** * Say hello to someone precisely - * + * * @param name The name of the person to say hello to * @return the number of current bookings */ @@ -49,7 +49,7 @@ public interface HelloWorldService { /** * Say hello to a list of people - * + * * @param names The list of names to say hello to * @return the number of current bookings */ diff --git a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java b/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java index 8fb17042af..07570e8d72 100644 --- a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java +++ b/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java @@ -23,7 +23,7 @@ /** * The implementation of the HelloWorld JAX-WS Web Service. - * + * * @author lnewson@redhat.com */ @WebService(serviceName = "HelloWorldService", portName = "HelloWorld", name = "HelloWorld", endpointInterface = "org.jboss.as.quickstarts.wshelloworld.HelloWorldService", targetNamespace = "http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld") @@ -52,9 +52,9 @@ public String sayHelloToNames(final List names) { /** * Creates a list of names separated by commas or an and symbol if its the last separation. This is then used to say hello to * the list of names. - * + * * i.e. if the input was {John, Mary, Luke} the output would be John, Mary & Luke - * + * * @param names A list of names * @return The list of names separated as described above. */ diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java index 81579f7ed6..6d89e0657c 100644 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java +++ b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java @@ -26,7 +26,7 @@ /** * A Client stub to the HelloWorld JAX-WS Web Service. - * + * * @author lnewson@redhat.com */ public class Client implements HelloWorldService { @@ -34,7 +34,7 @@ public class Client implements HelloWorldService { /** * Default constructor - * + * * @param url The URL to the Hello World WSDL endpoint. */ public Client(final URL wsdlUrl) { @@ -44,10 +44,10 @@ public Client(final URL wsdlUrl) { helloWorldService = service.getPort(HelloWorldService.class); assert (helloWorldService != null); } - + /** * Default constructor - * + * * @param url The URL to the Hello World WSDL endpoint. * @throws MalformedURLException if the WSDL url is malformed. */ diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqTest.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqTest.java index e6a9e7db10..4eb6771450 100644 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqTest.java +++ b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqTest.java @@ -35,7 +35,7 @@ /** * Simple set of tests for the HelloWorld Web Service to demonstrate accessing the web service using a client - * + * * @author lnewson@redhat.com */ @RunWith(Arquillian.class) diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientTest.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientTest.java index 2ff8bfc26b..2a627ad323 100644 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientTest.java +++ b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientTest.java @@ -30,7 +30,7 @@ /** * Simple set of tests for the HelloWorld Web Service to demonstrate accessing the web service using a client - * + * * @author lnewson@redhat.com */ public class ClientTest { @@ -42,7 +42,7 @@ public class ClientTest { * The path of the WSDL endpoint in relation to the deployed web application. */ private static final String WSDL_PATH = "HelloWorldService?wsdl"; - + /** * The name for the Server URL System Property. */ @@ -55,33 +55,33 @@ public class ClientTest { private static URL deploymentUrl; private HelloWorldService client; - + @BeforeClass public static void beforeClass() throws MalformedURLException { String deploymentUrl = System.getProperty(SERVER_URL_PROPERTY); - + // Check that the server URL property was set. If it wasn't then use the default. if (deploymentUrl == null || deploymentUrl.isEmpty()) { deploymentUrl = DEFAULT_SERVER_URL; } - + // Ensure that the URL ends with a forward slash if (!deploymentUrl.endsWith("/")) { deploymentUrl += "/"; } - + // Ensure the App Name is specified in the URL if (!deploymentUrl.matches(".*" + APP_NAME + ".*")) { deploymentUrl += APP_NAME + "/"; } - + // Add the WDSL Document location to the URL deploymentUrl += WSDL_PATH; - + System.out.println("WSDL Deployment URL: " + deploymentUrl); - + // Set the deployment url ClientTest.deploymentUrl = new URL(deploymentUrl); } diff --git a/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java b/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java index 68b1387469..28918dd8dd 100644 --- a/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java +++ b/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java @@ -18,9 +18,9 @@ /** * A simple CDI service which is able to say hello to someone - * + * * @author Pete Muir - * + * */ public class HelloService { diff --git a/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java b/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java index 003adf784f..68b5b9d887 100644 --- a/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java +++ b/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java @@ -30,14 +30,14 @@ *

* A simple servlet taking advantage of features added in 3.0. *

- * + * *

* The servlet is registered and mapped to /HelloServlet using the {@linkplain WebServlet * @HttpServlet}. The {@link HelloService} is injected by CDI. *

- * + * * @author Pete Muir - * + * */ @SuppressWarnings("serial") @WebServlet("/HelloWorld") diff --git a/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/model/Member.java b/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/model/Member.java index 9da4aa1511..97c05aa4dd 100644 --- a/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/model/Member.java +++ b/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/model/Member.java @@ -33,7 +33,7 @@ import org.hibernate.validator.constraints.NotEmpty; /*The Model uses JPA Entity as well as Hibernate Validators - * + * */ @Entity diff --git a/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/util/Resources.java b/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/util/Resources.java index 68862313c6..450eb654a1 100644 --- a/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/util/Resources.java +++ b/hibernate5/src/main/java/org/jboss/as/quickstart/hibernate/util/Resources.java @@ -27,11 +27,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans - * + * *

* Example injection on a managed bean field: *

- * + * *
  * @Inject
  * private EntityManager em;
diff --git a/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/ControllerA.java b/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/ControllerA.java
index 65c900a830..5ce543433c 100644
--- a/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/ControllerA.java
+++ b/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/ControllerA.java
@@ -30,9 +30,9 @@
  * Note that whilst EJBs are used to provide inter application communication, this is not apparent to consumers of Foo and Bar,
  * which use CDI style injection.
  * 

- * + * * @author Pete Muir - * + * */ @Named public class ControllerA { diff --git a/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/FooImpl.java b/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/FooImpl.java index 87e3336edf..1734e05fca 100644 --- a/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/FooImpl.java +++ b/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/FooImpl.java @@ -22,11 +22,11 @@ /** * The Foo bean is registered as an EJB singleton, allowing it to be used in other applications. - * + * * The {@link Foo} interface, which defines the contract that {@link FooImpl} exposes is placed in a shared jar. - * + * * @author Pete Muir - * + * */ @Singleton public class FooImpl implements Foo { diff --git a/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/Imports.java b/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/Imports.java index 1ae2455a8f..a23d94eb91 100644 --- a/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/Imports.java +++ b/inter-app/appA/src/main/java/org/jboss/as/quickstarts/interapp/appA/Imports.java @@ -24,9 +24,9 @@ /** * The Imports class is used to alias EJBs imported from other applications as local CDI beans, thus allowing consumers to * ignore the details of inter-application communication. - * + * * @author Pete Muir - * + * */ public class Imports { diff --git a/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/BarImpl.java b/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/BarImpl.java index 08b887d758..c0e12b22db 100644 --- a/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/BarImpl.java +++ b/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/BarImpl.java @@ -22,20 +22,20 @@ /** * The Bar bean is registered as an EJB singleton, allowing it to be used in other applications. - * + * * @author Pete Muir - * + * */ @Singleton public class BarImpl implements Bar { - + private String name; - + @Override public String getName() { return name; } - + @Override public void setName(String name) { this.name = name; diff --git a/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/ControllerB.java b/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/ControllerB.java index 7d6bcd8f87..9e4d44554b 100644 --- a/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/ControllerB.java +++ b/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/ControllerB.java @@ -30,9 +30,9 @@ * Note that whilst EJBs are used to provide inter application communication, this is not apparent to consumers of Foo and Bar, * which use CDI style injection. *

- * + * * @author Pete Muir - * + * */ @Named public class ControllerB { diff --git a/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/Imports.java b/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/Imports.java index 513bf927cf..1f9c96b56a 100644 --- a/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/Imports.java +++ b/inter-app/appB/src/main/java/org/jboss/as/quickstarts/interapp/appB/Imports.java @@ -24,9 +24,9 @@ /** * The Imports class is used to alias EJBs imported from other applications as local CDI beans, thus allowing consumers to * ignore the details of inter-application communication. - * + * * @author Pete Muir - * + * */ public class Imports { diff --git a/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Bar.java b/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Bar.java index 676e7e02d9..38976401eb 100644 --- a/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Bar.java +++ b/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Bar.java @@ -20,7 +20,7 @@ /** * Bar is provided in a shared API jar, that can be referenced by any application wishing to. - * + * * @author Pete Muir * */ diff --git a/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Foo.java b/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Foo.java index 8e3bf9c882..9f714da35d 100644 --- a/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Foo.java +++ b/inter-app/shared/src/main/java/org/jboss/as/quickstarts/interapp/shared/Foo.java @@ -20,7 +20,7 @@ /** * Bar is provided in a shared API jar, that can be referenced by any application wishing to. - * + * * @author Pete Muir * */ @@ -30,5 +30,5 @@ public interface Foo { public void setName(String name); public String getName(); - + } diff --git a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java b/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java index d0f65fb4cf..f900476486 100644 --- a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java +++ b/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java @@ -23,7 +23,7 @@ public class Contact { private String name; private String phoneNumber; - + private String savedBy; public Long getId() { @@ -49,11 +49,11 @@ public String getPhoneNumber() { public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } - + public String getSavedBy() { return savedBy; } - + public void setSavedBy(String savedBy) { this.savedBy = savedBy; } diff --git a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java b/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java index db526f2731..08a8750d5e 100644 --- a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java +++ b/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java @@ -22,7 +22,7 @@ /** * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 7 "no XML" approach to activating * JAX-RS. - * + * *

* Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

@@ -30,4 +30,4 @@ @ApplicationPath("/rest") public class JaxRsActivator extends Application { /* class body intentionally left blank */ -} \ No newline at end of file +} diff --git a/jaxws-addressing/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/AddressingTestCase.java b/jaxws-addressing/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/AddressingTestCase.java index 0c81b93702..0a1c2794c3 100644 --- a/jaxws-addressing/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/AddressingTestCase.java +++ b/jaxws-addressing/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/AddressingTestCase.java @@ -22,7 +22,7 @@ import javax.xml.ws.soap.AddressingFeature; /** - * + * * @author rsearls@redhat.com */ public final class AddressingTestCase diff --git a/jaxws-addressing/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/ServiceIface.java b/jaxws-addressing/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/ServiceIface.java index 39f58f4080..717ceb5f75 100644 --- a/jaxws-addressing/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/ServiceIface.java +++ b/jaxws-addressing/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/wsa/ServiceIface.java @@ -19,7 +19,7 @@ import javax.jws.WebService; /** - * + * * @author rsearls@redhat.com */ @WebService diff --git a/jaxws-ejb/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java b/jaxws-ejb/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java index 3cd3712e78..43a7505733 100644 --- a/jaxws-ejb/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java +++ b/jaxws-ejb/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java @@ -24,7 +24,7 @@ import java.net.URL; /** - * + * * @author rsearls@redhat.com */ public class Client { diff --git a/jaxws-ejb/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/EJB3RemoteInterface.java b/jaxws-ejb/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/EJB3RemoteInterface.java index 1e6a088ce5..21161f8208 100644 --- a/jaxws-ejb/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/EJB3RemoteInterface.java +++ b/jaxws-ejb/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/EJB3RemoteInterface.java @@ -19,7 +19,7 @@ import javax.jws.WebService; /** - * + * * @author rsearls@redhat@com */ @WebService diff --git a/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java b/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java index cb1401d4c3..719a6ff476 100644 --- a/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java +++ b/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java @@ -23,7 +23,7 @@ import java.net.URL; /** - * + * * @author rsearls@redhat.com */ public class Client { diff --git a/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java b/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java index 0243dcd6c4..15d0cc82c3 100644 --- a/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java +++ b/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java @@ -26,7 +26,7 @@ * This class was generated by Apache CXF 3.0.2 * 2014-11-19T10:28:42.197-05:00 * Generated source version: 3.0.2 - * + * */ @WebService(targetNamespace = "http://jsr181pojo.samples.jaxws.ws.quickstarts.jboss.org/", name = "JSEBean01") @SOAPBinding(style = SOAPBinding.Style.RPC) diff --git a/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01Service.java b/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01Service.java index ba268348be..d86b0e8005 100644 --- a/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01Service.java +++ b/jaxws-pojo/client/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01Service.java @@ -28,9 +28,9 @@ * This class was generated by Apache CXF 3.0.2 * 2014-11-19T10:28:42.289-05:00 * Generated source version: 3.0.2 - * + * */ -@WebServiceClient(name = "JSEBean01Service", +@WebServiceClient(name = "JSEBean01Service", wsdlLocation = "file:/tmp/JSEBean01Service.wsdl", targetNamespace = "http://jsr181pojo.samples.jaxws.ws.quickstarts.jboss.org/") public class JSEBean01Service extends Service { @@ -45,7 +45,7 @@ public class JSEBean01Service extends Service { url = new URL("file:/tmp/JSEBean01Service.wsdl"); } catch (MalformedURLException e) { java.util.logging.Logger.getLogger(JSEBean01Service.class.getName()) - .log(java.util.logging.Level.INFO, + .log(java.util.logging.Level.INFO, "Can not initialize the default wsdl from {0}", "file:/tmp/JSEBean01Service.wsdl"); } WSDL_LOCATION = url; @@ -62,7 +62,7 @@ public JSEBean01Service(URL wsdlLocation, QName serviceName) { public JSEBean01Service() { super(WSDL_LOCATION, SERVICE); } - + //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2 //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1 //compliant code instead. @@ -82,7 +82,7 @@ public JSEBean01Service(URL wsdlLocation, WebServiceFeature ... features) { //compliant code instead. public JSEBean01Service(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) { super(wsdlLocation, serviceName, features); - } + } /** * @@ -95,7 +95,7 @@ public org.jboss.quickstarts.ws.jaxws.samples.jsr181pojo.JSEBean01 getJSEBean01P } /** - * + * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. * @return diff --git a/jaxws-pojo/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java b/jaxws-pojo/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java index 4abeffaf59..1c6ec50ddd 100644 --- a/jaxws-pojo/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java +++ b/jaxws-pojo/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/jsr181pojo/JSEBean01.java @@ -21,7 +21,7 @@ import javax.jws.soap.SOAPBinding; /** - * + * * @author rsearls@redhat.com */ @WebService diff --git a/jaxws-retail/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java b/jaxws-retail/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java index abbbf8e1da..b411a7108d 100644 --- a/jaxws-retail/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java +++ b/jaxws-retail/client/src/main/java/org/jboss/quickstarts/ws/client/Client.java @@ -26,7 +26,7 @@ import java.net.URL; /** - * + * * @author rsearls@redhat.com */ public class Client { diff --git a/jaxws-retail/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java b/jaxws-retail/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java index 7eb40fde20..bb408b0813 100644 --- a/jaxws-retail/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java +++ b/jaxws-retail/service/src/main/java/org/jboss/quickstarts/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java @@ -25,7 +25,7 @@ import javax.jws.soap.SOAPBinding; /** - * + * * @author rsearls@redhat.com */ @Stateless @@ -43,4 +43,4 @@ public DiscountResponse getCustomerDiscount(DiscountRequest request){ dResponse.setDiscount(10.00); return dResponse; } -} \ No newline at end of file +} diff --git a/jsonp/src/main/java/org/jboss/as/quickstarts/jsonp/JsonController.java b/jsonp/src/main/java/org/jboss/as/quickstarts/jsonp/JsonController.java index 36270e20ca..b973a2d668 100644 --- a/jsonp/src/main/java/org/jboss/as/quickstarts/jsonp/JsonController.java +++ b/jsonp/src/main/java/org/jboss/as/quickstarts/jsonp/JsonController.java @@ -34,7 +34,7 @@ public class JsonController { private Person person; private String jsonString; - + private String parsedResult; public void generateJson() { @@ -54,7 +54,7 @@ public void generateJson() { ) .build().toString(); } - + public void parseJsonStream(){ StringBuilder sb = new StringBuilder(); String json = getJsonString(); @@ -83,7 +83,7 @@ public void parseJsonStream(){ } parsedResult = sb.toString(); } - + public void setJsonString(String jsonString) { this.jsonString = jsonString; } @@ -91,7 +91,7 @@ public void setJsonString(String jsonString) { public String getJsonString() { return jsonString; } - + public String getParsedResult() { return parsedResult; } diff --git a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/DbUpdaterMDB.java b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/DbUpdaterMDB.java index 6c4d38c6c7..d11951ed92 100644 --- a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/DbUpdaterMDB.java +++ b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/DbUpdaterMDB.java @@ -41,9 +41,9 @@ @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/jta-crash-rec-quickstart"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") }) public class DbUpdaterMDB implements MessageListener { - + private final static Logger LOGGER = Logger.getLogger(DbUpdaterMDB.class.getName()); - + // A helper service for persisting key value pairs @Inject private XAService xaService; diff --git a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/KVPair.java b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/KVPair.java index afe3348e63..1978b664ba 100644 --- a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/KVPair.java +++ b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/KVPair.java @@ -30,7 +30,7 @@ @SuppressWarnings("serial") @Entity public class KVPair implements Serializable { - + @Id @Column(unique = true, name = "name") private String key; diff --git a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAService.java b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAService.java index 9fa9781b0c..c4939e6d55 100644 --- a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAService.java +++ b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAService.java @@ -36,7 +36,7 @@ /** * A bean for updating a database and sending a JMS message within a single JTA transaction - * + * * @author Mike Musgrove */ public class XAService { @@ -113,12 +113,12 @@ private String listPairs() { /** * Update a key value database. The method must be called within a transaction. - * + * * @param entityManager an open JPA entity manager * @param delete if true then delete rows. If key is empty all rows are deleted. * @param key if not null then a pair is inserted into the database * @param value the value to be associated with the key - * + * * @return true if a key was inserted or a value modified */ public boolean modifyKeyValueTable(EntityManager entityManager, boolean delete, String key, String value) { @@ -161,11 +161,11 @@ public void modifyKeyValueTable(boolean delete, String key, String value) { /** * Update a key value database. The method must not be called within a transaction. - * + * * @param delete if true then delete rows. If key is empty all rows are deleted. * @param key if not null then a pair is inserted into the database * @param value the value to be associated with the key - * + * * @return The contents of the table after the update */ public String updateKeyValueDatabase(boolean delete, String key, String value) { diff --git a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAServlet.java b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAServlet.java index 1ae4033a19..d7d741c25a 100644 --- a/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAServlet.java +++ b/jta-crash-rec/src/main/java/org/jboss/as/quickstarts/xa/XAServlet.java @@ -47,9 +47,9 @@ public class XAServlet extends HttpServlet { // page content describing the quickstart and providing a form to perform basic operations against a database private static String PAGE_CONTENT = "

XA Recovery

" + "

This quickstart demonstrates how to atomically update multiple resources within one XA transaction. " + - "It updates a relational database table using JPA and sends a message using JMS. " + + "It updates a relational database table using JPA and sends a message using JMS. " + "In this example, you can perform the following operations:

" + - "
    " + + "
      " + "
    • To add a key/value pair, enter values in the input text boxes and click Submit
    • " + "
    • To update a key/value pair, enter the key and click Submit
    • " + "
    • To delete a key/value pair, enter the key and click Delete
    • " + @@ -74,7 +74,7 @@ public class XAServlet extends HttpServlet { "

      " + "

      See the README file located in the root of jta-crash-rec folder in the quickstart distribution " + "for complete instructions and details about how this quickstart works.

      " + - + "
      " + "Key: " + " (Leave blank to list all key/value pairs).
      " + diff --git a/jts/application-component-1/src/main/java/org/jboss/as/quickstarts/cmt/jts/ejb/CustomerManagerEJB.java b/jts/application-component-1/src/main/java/org/jboss/as/quickstarts/cmt/jts/ejb/CustomerManagerEJB.java index 7b9989d19c..006ed82e5d 100644 --- a/jts/application-component-1/src/main/java/org/jboss/as/quickstarts/cmt/jts/ejb/CustomerManagerEJB.java +++ b/jts/application-component-1/src/main/java/org/jboss/as/quickstarts/cmt/jts/ejb/CustomerManagerEJB.java @@ -57,7 +57,7 @@ public void createCustomer(String name) throws RemoteException, JMSException { /** * List all the customers. - * + * * @return * @throws NamingException * @throws NotSupportedException diff --git a/jts/application-component-2/src/main/java/org/jboss/as/quickstarts/cmt/jts/mdb/HelloWorldMDB.java b/jts/application-component-2/src/main/java/org/jboss/as/quickstarts/cmt/jts/mdb/HelloWorldMDB.java index d2798e8bf7..36886cfce1 100644 --- a/jts/application-component-2/src/main/java/org/jboss/as/quickstarts/cmt/jts/mdb/HelloWorldMDB.java +++ b/jts/application-component-2/src/main/java/org/jboss/as/quickstarts/cmt/jts/mdb/HelloWorldMDB.java @@ -30,9 +30,9 @@ * A simple Message Driven Bean that asynchronously receives and processes the * messages that are sent to the queue. *

      - * + * * @author Serge Pagop (spagop@redhat.com) - * + * */ @MessageDriven(name = "HelloWorldMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), diff --git a/kitchensink-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java b/kitchensink-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java index 9a901ba53d..537c7b003b 100644 --- a/kitchensink-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java +++ b/kitchensink-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java @@ -25,11 +25,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans - * + * *

      * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java b/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java
      index 17f7f641c9..fcca1faf89 100644
      --- a/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java
      +++ b/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java
      @@ -22,7 +22,7 @@
       /**
        * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 7 "no XML" approach to activating
        * JAX-RS.
      - * 
      + *
        * 

      * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

      diff --git a/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java b/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java index 2377dd4c10..d5a5f5c608 100644 --- a/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java +++ b/kitchensink-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java @@ -127,7 +127,7 @@ public Response createMember(Member member) { * If the error is caused because an existing member with the same email is registered it throws a regular validation * exception so that it can be interpreted separately. *

      - * + * * @param member Member to be validated * @throws ConstraintViolationException If Bean Validation errors exist * @throws ValidationException If member with the same email already exists @@ -149,7 +149,7 @@ private void validateMember(Member member) throws ConstraintViolationException, /** * Creates a JAX-RS "Bad Request" response including a map of all violation fields, and their message. This can then be used * by clients to show violations. - * + * * @param violations A set of violations that needs to be reported * @return JAX-RS response containing all violations */ @@ -168,7 +168,7 @@ private Response.ResponseBuilder createViolationResponse(Set * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/JaxRsActivator.java b/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/JaxRsActivator.java
      index c7fae5b5ef..d4d04a3201 100644
      --- a/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/JaxRsActivator.java
      +++ b/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/JaxRsActivator.java
      @@ -22,7 +22,7 @@
       /**
        * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE "no XML" approach to activating
        * JAX-RS.
      - * 
      + *
        * 

      * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

      diff --git a/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/MemberService.java b/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/MemberService.java index d24655aec9..5228c698d2 100644 --- a/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/MemberService.java +++ b/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/rest/MemberService.java @@ -126,7 +126,7 @@ public Response createMember(Member member) { * If the error is caused because an existing member with the same email is registered it throws a regular validation * exception so that it can be interpreted separately. *

      - * + * * @param member Member to be validated * @throws ConstraintViolationException If Bean Validation errors exist * @throws ValidationException If member with the same email already exists @@ -148,7 +148,7 @@ private void validateMember(Member member) throws ConstraintViolationException, /** * Creates a JAX-RS "Bad Request" response including a map of all violation fields, and their message. This can then be used * by clients to show violations. - * + * * @param violations A set of violations that needs to be reported * @return JAX-RS response containing all violations */ @@ -167,7 +167,7 @@ private Response.ResponseBuilder createViolationResponse(Set/rest/*
      path, and contain a query parameter call * jsoncallback that defines the JSONP callback method to use with the response. *

      - * + * * @author balunasj - * + * */ @WebFilter("/rest/*") public class JSONPRequestFilter implements Filter { @@ -140,4 +140,4 @@ private boolean isJSONPRequest(String callbackMethod) { public void destroy() { // Nothing to do } -} \ No newline at end of file +} diff --git a/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/util/Resources.java b/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/util/Resources.java index 16850ea17d..c3e7648d93 100644 --- a/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/util/Resources.java +++ b/kitchensink-html5-mobile/src/main/java/org/jboss/as/quickstarts/html5_mobile/util/Resources.java @@ -25,11 +25,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans - * + * *

      * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/kitchensink-html5-mobile/src/test/java/org/jboss/as/quickstarts/html5_mobile/test/MemberRegistrationTest.java b/kitchensink-html5-mobile/src/test/java/org/jboss/as/quickstarts/html5_mobile/test/MemberRegistrationTest.java
      index 3089f7766a..662147ceed 100644
      --- a/kitchensink-html5-mobile/src/test/java/org/jboss/as/quickstarts/html5_mobile/test/MemberRegistrationTest.java
      +++ b/kitchensink-html5-mobile/src/test/java/org/jboss/as/quickstarts/html5_mobile/test/MemberRegistrationTest.java
      @@ -43,7 +43,7 @@
       
       /**
        * Uses Arquilian to test the JAX-RS processing class for member registration.
      - * 
      + *
        * @author balunasj
        */
       @RunWith(Arquillian.class)
      diff --git a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/JaxRsActivator.java b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/JaxRsActivator.java
      index 55e1847f3a..43ce7dfd1d 100644
      --- a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/JaxRsActivator.java
      +++ b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/JaxRsActivator.java
      @@ -22,7 +22,7 @@
       /**
        * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 7 "no XML" approach to activating
        * JAX-RS.
      - * 
      + *
        * 

      * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

      diff --git a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/MemberResourceRESTService.java b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/MemberResourceRESTService.java index 1cae16a975..12e0b7ee93 100644 --- a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/MemberResourceRESTService.java +++ b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/rest/MemberResourceRESTService.java @@ -30,7 +30,7 @@ /** * JAX-RS Example - * + * * This class produces a RESTful service to read the contents of the members table. */ @Path("/members") diff --git a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/servlet/MemberRegistrationServlet.java b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/servlet/MemberRegistrationServlet.java index b361dc0bfa..5c2c4f4929 100644 --- a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/servlet/MemberRegistrationServlet.java +++ b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/servlet/MemberRegistrationServlet.java @@ -1,113 +1,113 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.kitchensinkjsp.servlet; - -import java.io.IOException; - -import javax.inject.Inject; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.jboss.as.quickstarts.kitchensinkjsp.controller.MemberRegistration; -import org.jboss.as.quickstarts.kitchensinkjsp.data.MemberListProducer; -import org.jboss.as.quickstarts.kitchensinkjsp.model.Member; - -/** - * Servlet implementation class MemberRegistrationServlet - */ -@WebServlet("/register.do") -public class MemberRegistrationServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - @Inject - MemberRegistration registrationService; - - @Inject - MemberListProducer memberListService; - - /** - * Default constructor. - */ - public MemberRegistrationServlet() { - // TODO Auto-generated constructor stub - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - StringBuilder errorMessage = new StringBuilder(); - - try { - - System.out.println("EMAIL='" + request.getParameter("email") + "'"); - Member member; - // create a new member, remember :) the memberservice do not - // call the initMethod if an error occur during the previous persist request - - while ((member = registrationService.getNewMember()) == null) { - registrationService.initNewMember(); - } - - String value; - - if ((value = request.getParameter("name")).length() < 1) { - errorMessage.append("Name can not be null\n"); - } else { - member.setName(value); - - if ((value = request.getParameter("email")).length() < 1) { - errorMessage.append("email required!\n"); - } else { - member.setEmail(value); - - if ((value = request.getParameter("phoneNumber")).length() < 1) { - errorMessage.append("phoneNumber required \n"); - } else // all parameters are filled, register - { - member.setPhoneNumber(value); - - log("\n*****************Try Registration of Member=" + member); - registrationService.register(); - request.setAttribute("infoMessage", member.getName() + " Registered!"); - } - } - } - - } catch (Exception e) { - - Throwable t = e; - while ((t.getCause()) != null) { - t = t.getCause(); - } - - errorMessage.append("Error========>" + t.getMessage()); - request.setAttribute("infoMessage", ""); - e.printStackTrace(); - } finally { - request.setAttribute("errorMessage", errorMessage.toString()); - RequestDispatcher resultView = request.getRequestDispatcher("index.jsp"); - resultView.forward(request, response); - } - } - -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.kitchensinkjsp.servlet; + +import java.io.IOException; + +import javax.inject.Inject; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.jboss.as.quickstarts.kitchensinkjsp.controller.MemberRegistration; +import org.jboss.as.quickstarts.kitchensinkjsp.data.MemberListProducer; +import org.jboss.as.quickstarts.kitchensinkjsp.model.Member; + +/** + * Servlet implementation class MemberRegistrationServlet + */ +@WebServlet("/register.do") +public class MemberRegistrationServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + @Inject + MemberRegistration registrationService; + + @Inject + MemberListProducer memberListService; + + /** + * Default constructor. + */ + public MemberRegistrationServlet() { + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + StringBuilder errorMessage = new StringBuilder(); + + try { + + System.out.println("EMAIL='" + request.getParameter("email") + "'"); + Member member; + // create a new member, remember :) the memberservice do not + // call the initMethod if an error occur during the previous persist request + + while ((member = registrationService.getNewMember()) == null) { + registrationService.initNewMember(); + } + + String value; + + if ((value = request.getParameter("name")).length() < 1) { + errorMessage.append("Name can not be null\n"); + } else { + member.setName(value); + + if ((value = request.getParameter("email")).length() < 1) { + errorMessage.append("email required!\n"); + } else { + member.setEmail(value); + + if ((value = request.getParameter("phoneNumber")).length() < 1) { + errorMessage.append("phoneNumber required \n"); + } else // all parameters are filled, register + { + member.setPhoneNumber(value); + + log("\n*****************Try Registration of Member=" + member); + registrationService.register(); + request.setAttribute("infoMessage", member.getName() + " Registered!"); + } + } + } + + } catch (Exception e) { + + Throwable t = e; + while ((t.getCause()) != null) { + t = t.getCause(); + } + + errorMessage.append("Error========>" + t.getMessage()); + request.setAttribute("infoMessage", ""); + e.printStackTrace(); + } finally { + request.setAttribute("errorMessage", errorMessage.toString()); + RequestDispatcher resultView = request.getRequestDispatcher("index.jsp"); + resultView.forward(request, response); + } + } + +} diff --git a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/util/Resources.java b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/util/Resources.java index 933ddbfd56..859c9b4fa2 100644 --- a/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/util/Resources.java +++ b/kitchensink-jsp/src/main/java/org/jboss/as/quickstarts/kitchensinkjsp/util/Resources.java @@ -25,11 +25,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans - * + * *

      * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/kitchensink-ml-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java b/kitchensink-ml-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java
      index 1c886e9e41..2f6d5c761c 100644
      --- a/kitchensink-ml-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java
      +++ b/kitchensink-ml-ear/ejb/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/util/Resources.java
      @@ -25,11 +25,11 @@
       
       /**
        * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans
      - * 
      + *
        * 

      * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java b/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java
      index 17f7f641c9..fcca1faf89 100644
      --- a/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java
      +++ b/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/JaxRsActivator.java
      @@ -22,7 +22,7 @@
       /**
        * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 7 "no XML" approach to activating
        * JAX-RS.
      - * 
      + *
        * 

      * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

      diff --git a/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java b/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java index 2377dd4c10..d5a5f5c608 100644 --- a/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java +++ b/kitchensink-ml-ear/web/src/main/java/org/jboss/as/quickstarts/kitchensink_ear/rest/MemberResourceRESTService.java @@ -127,7 +127,7 @@ public Response createMember(Member member) { * If the error is caused because an existing member with the same email is registered it throws a regular validation * exception so that it can be interpreted separately. *

      - * + * * @param member Member to be validated * @throws ConstraintViolationException If Bean Validation errors exist * @throws ValidationException If member with the same email already exists @@ -149,7 +149,7 @@ private void validateMember(Member member) throws ConstraintViolationException, /** * Creates a JAX-RS "Bad Request" response including a map of all violation fields, and their message. This can then be used * by clients to show violations. - * + * * @param violations A set of violations that needs to be reported * @return JAX-RS response containing all violations */ @@ -168,7 +168,7 @@ private Response.ResponseBuilder createViolationResponse(Set * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java b/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java
      index 549744ec3f..163580a23f 100644
      --- a/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java
      +++ b/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java
      @@ -22,7 +22,7 @@
       /**
        * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 7 "no XML" approach to activating
        * JAX-RS.
      - * 
      + *
        * 

      * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

      diff --git a/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java b/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java index a0bb4310d1..30af6a5de3 100644 --- a/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java +++ b/kitchensink-ml/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java @@ -128,7 +128,7 @@ public Response createMember(Member member) { * If the error is caused because an existing member with the same email is registered it throws a regular validation * exception so that it can be interpreted separately. *

      - * + * * @param member Member to be validated * @throws ConstraintViolationException If Bean Validation errors exist * @throws ValidationException If member with the same email already exists @@ -150,7 +150,7 @@ private void validateMember(Member member) throws ConstraintViolationException, /** * Creates a JAX-RS "Bad Request" response including a map of all violation fields, and their message. This can then be used * by clients to show violations. - * + * * @param violations A set of violations that needs to be reported * @return JAX-RS response containing all violations */ @@ -169,7 +169,7 @@ private Response.ResponseBuilder createViolationResponse(Set * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java b/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java
      index 549744ec3f..163580a23f 100644
      --- a/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java
      +++ b/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java
      @@ -22,7 +22,7 @@
       /**
        * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 7 "no XML" approach to activating
        * JAX-RS.
      - * 
      + *
        * 

      * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

      diff --git a/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java b/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java index a0bb4310d1..30af6a5de3 100644 --- a/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java +++ b/kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java @@ -128,7 +128,7 @@ public Response createMember(Member member) { * If the error is caused because an existing member with the same email is registered it throws a regular validation * exception so that it can be interpreted separately. *

      - * + * * @param member Member to be validated * @throws ConstraintViolationException If Bean Validation errors exist * @throws ValidationException If member with the same email already exists @@ -150,7 +150,7 @@ private void validateMember(Member member) throws ConstraintViolationException, /** * Creates a JAX-RS "Bad Request" response including a map of all violation fields, and their message. This can then be used * by clients to show violations. - * + * * @param violations A set of violations that needs to be reported * @return JAX-RS response containing all violations */ @@ -169,7 +169,7 @@ private Response.ResponseBuilder createViolationResponse(Set * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/log4j/src/main/java/org/jboss/as/quickstarts/log4jdemo/Log4jDemo.java b/log4j/src/main/java/org/jboss/as/quickstarts/log4jdemo/Log4jDemo.java
      index 623e9bfda4..f813c681e0 100644
      --- a/log4j/src/main/java/org/jboss/as/quickstarts/log4jdemo/Log4jDemo.java
      +++ b/log4j/src/main/java/org/jboss/as/quickstarts/log4jdemo/Log4jDemo.java
      @@ -30,9 +30,9 @@
        * 

      * The {@link #text} variable is populated with content which is logged in {@link #log()} method. *

      - * + * * @author baranowb - * + * */ @SessionScoped @Named diff --git a/logging-tools/src/main/java/org/jboss/as/quickstarts/loggingToolsQS/GreeterService.java b/logging-tools/src/main/java/org/jboss/as/quickstarts/loggingToolsQS/GreeterService.java index 1c1c7a0909..9a351b7125 100644 --- a/logging-tools/src/main/java/org/jboss/as/quickstarts/loggingToolsQS/GreeterService.java +++ b/logging-tools/src/main/java/org/jboss/as/quickstarts/loggingToolsQS/GreeterService.java @@ -79,7 +79,7 @@ public String getHelloNameForLocale(@PathParam("name") String name, @PathParam(" // ====================================================================== // this is a particularly contrived example. It is here merely to demonstrate - // the throwing of a localized exception with another exception as the cause. + // the throwing of a localized exception with another exception as the cause. @GET @Path("crashme") @Produces(MediaType.TEXT_PLAIN) diff --git a/mail/src/main/java/org/jboss/as/quickstarts/mail/Email.java b/mail/src/main/java/org/jboss/as/quickstarts/mail/Email.java index a3aa4a4a52..97bbf074df 100644 --- a/mail/src/main/java/org/jboss/as/quickstarts/mail/Email.java +++ b/mail/src/main/java/org/jboss/as/quickstarts/mail/Email.java @@ -38,9 +38,9 @@ *

      * The {@link #send()} method provides the business logic to send the email *

      - * + * * @author Joel Tosi - * + * */ @Named @@ -99,7 +99,7 @@ public void setBody(String body) { /** * Method to send the email based upon values entered in the JSF view. Exception should be handled in a production usage but * is not handled in this example. - * + * * @throws Exception */ public void send() throws Exception { diff --git a/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/model/Product.java b/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/model/Product.java index 3e71309124..864a3f0561 100644 --- a/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/model/Product.java +++ b/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/model/Product.java @@ -56,4 +56,4 @@ public void setPrice(Integer price) { this.price = price; } -} \ No newline at end of file +} diff --git a/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/rest/JaxRsActivator.java b/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/rest/JaxRsActivator.java index dd8f674a57..91a5be66b7 100644 --- a/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/rest/JaxRsActivator.java +++ b/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/rest/JaxRsActivator.java @@ -22,7 +22,7 @@ /** * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 7 "no XML" approach to activating * JAX-RS. - * + * *

      * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. *

      @@ -30,4 +30,4 @@ @ApplicationPath("/rest") public class JaxRsActivator extends Application { /* class body intentionally left blank */ -} \ No newline at end of file +} diff --git a/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/util/Resources.java b/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/util/Resources.java index aee8f04970..9852440c37 100644 --- a/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/util/Resources.java +++ b/managedexecutorservice/src/main/java/org/jboss/as/quickstarts/managedexecutorservice/util/Resources.java @@ -25,11 +25,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans - * + * *

      * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      @@ -46,4 +46,4 @@ public Logger produceLog(InjectionPoint injectionPoint) {
               return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getSimpleName());
           }
       
      -}
      \ No newline at end of file
      +}
      diff --git a/managedexecutorservice/src/test/java/org/jboss/as/quickstarts/managedexecutorservice/test/ProductsRestClientTest.java b/managedexecutorservice/src/test/java/org/jboss/as/quickstarts/managedexecutorservice/test/ProductsRestClientTest.java
      index 682353dd43..c8e708255e 100644
      --- a/managedexecutorservice/src/test/java/org/jboss/as/quickstarts/managedexecutorservice/test/ProductsRestClientTest.java
      +++ b/managedexecutorservice/src/test/java/org/jboss/as/quickstarts/managedexecutorservice/test/ProductsRestClientTest.java
      @@ -51,4 +51,4 @@ public void testRestResources() {
               response = ClientBuilder.newClient().target(REST_TARGET_URL).request().delete();
               Assert.assertEquals(Response.ok().build().getStatus(), response.getStatus());
           }
      -}
      \ No newline at end of file
      +}
      diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java
      index 83c34bcf71..5b77d0ee7c 100644
      --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java
      +++ b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java
      @@ -41,9 +41,9 @@
        * The {@link #check()} method, and {@link #reset()} methods provide the business logic whilst the
        * {@link #validateNumberRange(FacesContext, UIComponent, Object)} method provides feedback to the user.
        * 

      - * + * * @author Pete Muir - * + * */ @SuppressWarnings("serial") @Named @@ -148,7 +148,7 @@ public void reset() { /** * A JSF validation method which checks whether the guess is valid. It might not be valid because there are no guesses left, * or because the guess is not in range. - * + * */ public void validateNumberRange(FacesContext context, UIComponent toValidate, Object value) { if (remainingGuesses <= 0) { diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java index 3013ed8dd4..968578d8bb 100644 --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java +++ b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java @@ -25,20 +25,20 @@ *

      * Random number generator. *

      - * + * *

      * Placing the random number generation, as well as the configuring the maximum number allows for a more loosely coupled * application. We can now change out the implementation of number generation without any effect on the client code. We also * produce a more intuitive design - both are identifed by the fact they are numbers (int) and that they are qualified as the * maximum number or a random number. *

      - * + * *

      * We use the application scope to store the random number generator so that we use the same seed. *

      - * + * * @author Pete Muir - * + * */ @SuppressWarnings("serial") @ApplicationScoped diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java index 07eab4d1bd..025b981063 100644 --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java +++ b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java @@ -30,9 +30,9 @@ /** * Qualifier for the maximum number - * + * * @author Pete Muir - * + * */ @Target({ TYPE, METHOD, PARAMETER, FIELD }) @Retention(RUNTIME) diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java index f4cc9dfeb1..bc6d3593c1 100644 --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java +++ b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java @@ -30,9 +30,9 @@ /** * Qualifier for random numbers - * + * * @author Pete Muir - * + * */ @Target({ TYPE, METHOD, PARAMETER, FIELD }) @Retention(RUNTIME) diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/beans/PaymentBean.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/beans/PaymentBean.java index c9661069aa..a4be86dd65 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/beans/PaymentBean.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/beans/PaymentBean.java @@ -1,124 +1,124 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.beans; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; -import java.util.logging.Logger; - -import javax.enterprise.context.SessionScoped; -import javax.enterprise.event.Event; -import javax.inject.Inject; -import javax.inject.Named; - -import org.jboss.as.quickstarts.payment.events.PaymentEvent; -import org.jboss.as.quickstarts.payment.events.PaymentTypeEnum; -import org.jboss.as.quickstarts.payment.qualifiers.Credit; -import org.jboss.as.quickstarts.payment.qualifiers.Debit; - -@Named -@SessionScoped -public class PaymentBean implements Serializable { - - private static final long serialVersionUID = 1L; - - @Inject - private Logger log; - - // Events producers - @Inject - @Credit - Event creditEventProducer; - - @Inject - @Debit - Event debitEventProducer; - - private BigDecimal amount = new BigDecimal(10.0); - - private String paymentOption = PaymentTypeEnum.DEBIT.toString(); - - // Pay Action - public String pay() { - - PaymentEvent currentEvtPayload = new PaymentEvent(); - currentEvtPayload.setType(PaymentTypeEnum.fromString(paymentOption)); - currentEvtPayload.setAmount(amount); - currentEvtPayload.setDatetime(new Date()); - - switch (currentEvtPayload.getType()) { - case DEBIT: - - debitEventProducer.fire(currentEvtPayload); - - break; - case CREDIT: - creditEventProducer.fire(currentEvtPayload); - - break; - - default: - log.severe("invalid payment option"); - break; - } - - // paymentAction - - return "index"; - } - - // Reset Action - public void reset() { - amount = null; - paymentOption = ""; - - } - - public Event getCreditEventLauncher() { - return creditEventProducer; - } - - public void setCreditEventLauncher(Event creditEventLauncher) { - this.creditEventProducer = creditEventLauncher; - } - - public Event getDebitEventLauncher() { - return debitEventProducer; - } - - public void setDebitEventLauncher(Event debitEventLauncher) { - this.debitEventProducer = debitEventLauncher; - } - - public String getPaymentOption() { - return paymentOption; - } - - public void setPaymentOption(String paymentOption) { - this.paymentOption = paymentOption; - } - - public BigDecimal getAmount() { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.beans; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.logging.Logger; + +import javax.enterprise.context.SessionScoped; +import javax.enterprise.event.Event; +import javax.inject.Inject; +import javax.inject.Named; + +import org.jboss.as.quickstarts.payment.events.PaymentEvent; +import org.jboss.as.quickstarts.payment.events.PaymentTypeEnum; +import org.jboss.as.quickstarts.payment.qualifiers.Credit; +import org.jboss.as.quickstarts.payment.qualifiers.Debit; + +@Named +@SessionScoped +public class PaymentBean implements Serializable { + + private static final long serialVersionUID = 1L; + + @Inject + private Logger log; + + // Events producers + @Inject + @Credit + Event creditEventProducer; + + @Inject + @Debit + Event debitEventProducer; + + private BigDecimal amount = new BigDecimal(10.0); + + private String paymentOption = PaymentTypeEnum.DEBIT.toString(); + + // Pay Action + public String pay() { + + PaymentEvent currentEvtPayload = new PaymentEvent(); + currentEvtPayload.setType(PaymentTypeEnum.fromString(paymentOption)); + currentEvtPayload.setAmount(amount); + currentEvtPayload.setDatetime(new Date()); + + switch (currentEvtPayload.getType()) { + case DEBIT: + + debitEventProducer.fire(currentEvtPayload); + + break; + case CREDIT: + creditEventProducer.fire(currentEvtPayload); + + break; + + default: + log.severe("invalid payment option"); + break; + } + + // paymentAction + + return "index"; + } + + // Reset Action + public void reset() { + amount = null; + paymentOption = ""; + + } + + public Event getCreditEventLauncher() { + return creditEventProducer; + } + + public void setCreditEventLauncher(Event creditEventLauncher) { + this.creditEventProducer = creditEventLauncher; + } + + public Event getDebitEventLauncher() { + return debitEventProducer; + } + + public void setDebitEventLauncher(Event debitEventLauncher) { + this.debitEventProducer = debitEventLauncher; + } + + public String getPaymentOption() { + return paymentOption; + } + + public void setPaymentOption(String paymentOption) { + this.paymentOption = paymentOption; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentEvent.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentEvent.java index 192542a213..7a8303a5e0 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentEvent.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentEvent.java @@ -1,56 +1,56 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.events; - -import java.math.BigDecimal; -import java.util.Date; - -public class PaymentEvent { - - private PaymentTypeEnum type; // credit or debit - private BigDecimal amount; - private Date datetime; - - public BigDecimal getAmount() { - return amount; - } - - public PaymentTypeEnum getType() { - return type; - } - - public void setType(PaymentTypeEnum type) { - this.type = type; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - - public Date getDatetime() { - return datetime; - } - - public void setDatetime(Date datetime) { - this.datetime = datetime; - } - - public String toString() { - return "EVT:" + getDatetime() + ":$" + getAmount() + ":" + getType(); - } - -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.events; + +import java.math.BigDecimal; +import java.util.Date; + +public class PaymentEvent { + + private PaymentTypeEnum type; // credit or debit + private BigDecimal amount; + private Date datetime; + + public BigDecimal getAmount() { + return amount; + } + + public PaymentTypeEnum getType() { + return type; + } + + public void setType(PaymentTypeEnum type) { + this.type = type; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Date getDatetime() { + return datetime; + } + + public void setDatetime(Date datetime) { + this.datetime = datetime; + } + + public String toString() { + return "EVT:" + getDatetime() + ":$" + getAmount() + ":" + getType(); + } + +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentTypeEnum.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentTypeEnum.java index 378fb9bd67..5c63d968ee 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentTypeEnum.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/events/PaymentTypeEnum.java @@ -1,47 +1,47 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.events; - -import java.util.HashMap; -import java.util.Map; - -public enum PaymentTypeEnum { - - CREDIT("1"), DEBIT("2"); - - private final String value; - - static Map map = new HashMap<>(); - - static { - for (PaymentTypeEnum paymentType : PaymentTypeEnum.values()) { - map.put(paymentType.getValue(), paymentType); - } - } - - private PaymentTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentTypeEnum fromString(String value) { - return map.get(value); - } -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.events; + +import java.util.HashMap; +import java.util.Map; + +public enum PaymentTypeEnum { + + CREDIT("1"), DEBIT("2"); + + private final String value; + + static Map map = new HashMap<>(); + + static { + for (PaymentTypeEnum paymentType : PaymentTypeEnum.values()) { + map.put(paymentType.getValue(), paymentType); + } + } + + private PaymentTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentTypeEnum fromString(String value) { + return map.get(value); + } +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/ICreditEventObserver.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/ICreditEventObserver.java index 28dd00bacc..9ba68c4a93 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/ICreditEventObserver.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/ICreditEventObserver.java @@ -1,34 +1,34 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.handler; - -/** - * - * @author Elvadas-Nono - * - */ - -import javax.enterprise.event.Observes; - -import org.jboss.as.quickstarts.payment.events.PaymentEvent; -import org.jboss.as.quickstarts.payment.qualifiers.Credit; - -public interface ICreditEventObserver { - - public void onCreditPaymentEvent(@Observes @Credit PaymentEvent event); - -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.handler; + +/** + * + * @author Elvadas-Nono + * + */ + +import javax.enterprise.event.Observes; + +import org.jboss.as.quickstarts.payment.events.PaymentEvent; +import org.jboss.as.quickstarts.payment.qualifiers.Credit; + +public interface ICreditEventObserver { + + public void onCreditPaymentEvent(@Observes @Credit PaymentEvent event); + +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/IDebitEventObserver.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/IDebitEventObserver.java index 5afa2a46fc..d12d4b7e57 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/IDebitEventObserver.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/IDebitEventObserver.java @@ -1,34 +1,34 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.handler; - -/** - * - * @author Elvadas-Nono - * - */ - -import javax.enterprise.event.Observes; - -import org.jboss.as.quickstarts.payment.events.PaymentEvent; -import org.jboss.as.quickstarts.payment.qualifiers.Debit; - -public interface IDebitEventObserver { - - public void onDebitPaymentEvent(@Observes @Debit PaymentEvent event); - -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.handler; + +/** + * + * @author Elvadas-Nono + * + */ + +import javax.enterprise.event.Observes; + +import org.jboss.as.quickstarts.payment.events.PaymentEvent; +import org.jboss.as.quickstarts.payment.qualifiers.Debit; + +public interface IDebitEventObserver { + + public void onDebitPaymentEvent(@Observes @Debit PaymentEvent event); + +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/PaymentHandler.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/PaymentHandler.java index 191128878f..80c261aa35 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/PaymentHandler.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/handler/PaymentHandler.java @@ -1,66 +1,66 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.handler; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Logger; - -import javax.enterprise.context.SessionScoped; -import javax.enterprise.event.Observes; -import javax.enterprise.inject.Produces; -import javax.inject.Inject; -import javax.inject.Named; - -import org.jboss.as.quickstarts.payment.events.PaymentEvent; -import org.jboss.as.quickstarts.payment.qualifiers.Credit; -import org.jboss.as.quickstarts.payment.qualifiers.Debit; - -@SessionScoped -public class PaymentHandler implements Serializable, ICreditEventObserver, IDebitEventObserver { - - /** - * - */ - private static final long serialVersionUID = 1L; - - @Inject - private Logger logger; - - List payments = new ArrayList<>(); - - @Produces - @Named - public List getPayments() { - return payments; - } - - public void onCreditPaymentEvent(@Observes @Credit PaymentEvent event) { - - logger.info("Processing the credit operation " + event); - payments.add(event); - } - - @Override - public void onDebitPaymentEvent(@Observes @Debit PaymentEvent event) { - logger.info("Processing the debit operation " + event); - payments.add(event); - - } - -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.handler; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; + +import javax.enterprise.context.SessionScoped; +import javax.enterprise.event.Observes; +import javax.enterprise.inject.Produces; +import javax.inject.Inject; +import javax.inject.Named; + +import org.jboss.as.quickstarts.payment.events.PaymentEvent; +import org.jboss.as.quickstarts.payment.qualifiers.Credit; +import org.jboss.as.quickstarts.payment.qualifiers.Debit; + +@SessionScoped +public class PaymentHandler implements Serializable, ICreditEventObserver, IDebitEventObserver { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @Inject + private Logger logger; + + List payments = new ArrayList<>(); + + @Produces + @Named + public List getPayments() { + return payments; + } + + public void onCreditPaymentEvent(@Observes @Credit PaymentEvent event) { + + logger.info("Processing the credit operation " + event); + payments.add(event); + } + + @Override + public void onDebitPaymentEvent(@Observes @Debit PaymentEvent event) { + logger.info("Processing the debit operation " + event); + payments.add(event); + + } + +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Credit.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Credit.java index b5d3f735a1..2b3da7c06f 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Credit.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Credit.java @@ -1,33 +1,33 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.qualifiers; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; -import java.lang.annotation.RetentionPolicy; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.PARAMETER; - -@Qualifier -@Target({TYPE, METHOD, FIELD, PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Credit { -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.qualifiers; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.inject.Qualifier; +import java.lang.annotation.RetentionPolicy; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.PARAMETER; + +@Qualifier +@Target({TYPE, METHOD, FIELD, PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Credit { +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Debit.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Debit.java index 2f942a31b4..18509132b0 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Debit.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/qualifiers/Debit.java @@ -1,33 +1,33 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.payment.qualifiers; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; -import java.lang.annotation.RetentionPolicy; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.PARAMETER; - -@Qualifier -@Target({TYPE, METHOD, FIELD, PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Debit { -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.payment.qualifiers; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.inject.Qualifier; +import java.lang.annotation.RetentionPolicy; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.PARAMETER; + +@Qualifier +@Target({TYPE, METHOD, FIELD, PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Debit { +} diff --git a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/resources/Resources.java b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/resources/Resources.java index 58f0b9b733..0493c6c351 100644 --- a/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/resources/Resources.java +++ b/payment-cdi-event/src/main/java/org/jboss/as/quickstarts/payment/resources/Resources.java @@ -23,11 +23,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans - * + * *

      * Example injection on a managed bean field: *

      - * + * */ public class Resources { diff --git a/picketlink-sts/src/main/java/org/jboss/as/quickstarts/picketlink/WSTrustClientExample.java b/picketlink-sts/src/main/java/org/jboss/as/quickstarts/picketlink/WSTrustClientExample.java index dae1efc96c..c5646cdd3f 100644 --- a/picketlink-sts/src/main/java/org/jboss/as/quickstarts/picketlink/WSTrustClientExample.java +++ b/picketlink-sts/src/main/java/org/jboss/as/quickstarts/picketlink/WSTrustClientExample.java @@ -25,19 +25,19 @@ /** * This class demonstrates how to request SAML 2.0 security token from PicketLink STS. - * + * * @author Peter Skopek (pskopek ( at redhat dot com)) * */ public class WSTrustClientExample { public static void main(String[] args) throws Exception { - + String userName = (args.length > 0 ? args[0] : "tomcat"); String password = (args.length > 1 ? args[1] : "tomcat"); - + // Step 1: Create a WS Trust Client - WSTrustClient client = new WSTrustClient("PicketLinkSTS", "PicketLinkSTSPort", "http://localhost:8080/picketlink-sts/PicketLinkSTS", + WSTrustClient client = new WSTrustClient("PicketLinkSTS", "PicketLinkSTSPort", "http://localhost:8080/picketlink-sts/PicketLinkSTS", new SecurityInfo(userName, password)); Element assertionElement = null; try { @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception { e.printStackTrace(); System.exit(2); } - + // Step 3: Display the SAML2 token String el = DocumentUtil.getDOMElementAsString(assertionElement); System.out.println(el); diff --git a/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java b/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java index 4faa0594f4..c39a9db48b 100644 --- a/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java +++ b/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java @@ -29,7 +29,7 @@ *

      * Default implementation of the {@code SecurityTokenService} interface. *

      - * + * * @author Stefan Guilhen * @author Peter Skopek */ @@ -44,4 +44,4 @@ public void setWSC(WebServiceContext wctx) { this.context = wctx; } -} \ No newline at end of file +} diff --git a/resteasy-jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/JaxRsClientTest.java b/resteasy-jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/JaxRsClientTest.java index b215ebe0e5..cff2e66bd4 100644 --- a/resteasy-jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/JaxRsClientTest.java +++ b/resteasy-jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/JaxRsClientTest.java @@ -18,10 +18,10 @@ /** * This example demonstrates the use an external JAX-RS RestEasy client - * which interacts with a JAX-RS Web service that uses CDI 1.0 and JAX-RS - * in Red Hat JBoss Enterprise Application Platform. Specifically, - * this client "calls" the HelloWorld JAX-RS Web Service created in - * quickstart helloworld-rs. Please refer to the helloworld-rs README.md + * which interacts with a JAX-RS Web service that uses CDI 1.0 and JAX-RS + * in Red Hat JBoss Enterprise Application Platform. Specifically, + * this client "calls" the HelloWorld JAX-RS Web Service created in + * quickstart helloworld-rs. Please refer to the helloworld-rs README.md * for instructions on how to build and deploy helloworld-rs. */ import static org.junit.Assert.*; @@ -41,9 +41,9 @@ /** * JUnit4 Test class which makes a request to the RESTful helloworld-rs web service. - * + * * @author bmincey (Blaine Mincey) - * + * */ public class JaxRsClientTest { /** @@ -87,7 +87,7 @@ public void test() { /** * The purpose of this method is to run the external REST request. - * + * * @param url The url of the RESTful service * @param mediaType The mediatype of the RESTful service */ diff --git a/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java b/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java index 21d21f08f4..8678a0c16f 100644 --- a/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java +++ b/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java @@ -27,25 +27,25 @@ *

      * A simple asynchronous servlet taking advantage of features added in 3.0. *

      - * + * *

      * The servlet is registered and mapped to /AsynchronousServlet using the {@link WebServlet} annotation. The * {@link LongRunningService} is injected by CDI. *

      - * + * *

      * It shows how to detach the execution of a long-running task from the request processing thread, so the thread is free to * serve other client requests. The long-running tasks are executed using a dedicated thread pool and create the client response * asynchronously using the {@link AsyncContext}. *

      - * + * *

      * A long-running task in this context does not refer to a computation intensive task executed on the same machine but could for * example be contacting a third-party service that has limited resources or only allows for a limited number of concurrent * connections. Moving the calls to this service into a separate and smaller sized thread pool ensures that less threads will be * busy interacting with the long-running service and that more requests can be served that do not depend on this service. *

      - * + * * @author Christian Sadilek */ @SuppressWarnings("serial") diff --git a/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/LongRunningService.java b/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/LongRunningService.java index 59046caa31..4981918973 100644 --- a/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/LongRunningService.java +++ b/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/LongRunningService.java @@ -28,7 +28,7 @@ /** * A simple service to simulate the execution of a long running task. - * + * * @author Christian Sadilek */ @Stateless @@ -39,7 +39,7 @@ public class LongRunningService { /** * The use of {@link Asynchronous} causes this EJB method to be executed asynchronously, by a different thread from a * dedicated, container managed thread pool. - * + * * @param asyncContext the context for a suspended Servlet request that this EJB will complete later. */ @Asynchronous diff --git a/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/FilterExampleServlet.java b/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/FilterExampleServlet.java index 15a1518536..912a28ecf9 100644 --- a/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/FilterExampleServlet.java +++ b/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/FilterExampleServlet.java @@ -27,7 +27,7 @@ /** * A simple servlet that exists as a target for Servlet Filters and Servlet Listeners. - * + * * @author Jonathan Fuerth */ @SuppressWarnings("serial") diff --git a/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/ParameterDumpingRequestListener.java b/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/ParameterDumpingRequestListener.java index d258cf5839..547a36b257 100644 --- a/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/ParameterDumpingRequestListener.java +++ b/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/ParameterDumpingRequestListener.java @@ -28,7 +28,7 @@ *

      * Because Request Listeners see requests before Filters see them, this listener sees the original parameter values as sent by * the user rather than the modified ones passed down the filter chain by {@link VowelRemoverFilter}. - * + * * @author Jonathan Fuerth */ @WebListener diff --git a/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/VowelRemoverFilter.java b/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/VowelRemoverFilter.java index 37d660c079..edfdc80ccb 100644 --- a/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/VowelRemoverFilter.java +++ b/servlet-filterlistener/src/main/java/org/jboss/as/quickstarts/servlet/filterlistener/VowelRemoverFilter.java @@ -55,7 +55,7 @@ *

      * Note that this application also employs a {@linkplain ParameterDumpingRequestListener Request Listener}, which will see all * requests before this Filter sees them. - * + * * @author Jonathan Fuerth */ @WebFilter("/*") @@ -132,7 +132,7 @@ public String[] getParameterValues(String name) { /** * Performs the vowel removal work of this filter. - * + * * @param parameterMap the map of parameter names and values in the original request. * @return A copy of the original map with all the same keys, but whose values do not contain vowels. */ diff --git a/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java b/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java index e15d121d4f..2c0aceaddf 100644 --- a/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java +++ b/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java @@ -31,9 +31,9 @@ /** * A simple secured Servlet. Upon successful authentication and authorization the Servlet will print details of the user and * authentication. Servlet security is implemented using annotations. - * + * * @author Sherif Makary - * + * */ @SuppressWarnings("serial") @WebServlet("/SecuredServlet") diff --git a/shrinkwrap-resolver/src/main/java/org/jboss/as/quickstarts/shrinkwrap/resolver/MyBean.java b/shrinkwrap-resolver/src/main/java/org/jboss/as/quickstarts/shrinkwrap/resolver/MyBean.java index 3805d02f5f..27050f9cdd 100644 --- a/shrinkwrap-resolver/src/main/java/org/jboss/as/quickstarts/shrinkwrap/resolver/MyBean.java +++ b/shrinkwrap-resolver/src/main/java/org/jboss/as/quickstarts/shrinkwrap/resolver/MyBean.java @@ -20,15 +20,15 @@ /** * This is a simple CDI Bean that will be injected on test cases - * + * * @author Rafael Benevides - * + * */ public class MyBean { /* * (non-Javadoc) - * + * * @see java.lang.Object#toString() */ @Override diff --git a/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapImportFromPomTest.java b/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapImportFromPomTest.java index 638804ea2d..98f521289a 100644 --- a/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapImportFromPomTest.java +++ b/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapImportFromPomTest.java @@ -35,10 +35,10 @@ * This test demonstrates how to use Shrinkwrap-resolver to import dependencies specified in the pom.xml file. You can control * what dependencies will be imported based on its scope and you can also define what profiles can be active or inactive. It * returns a file array with the dependencies. - * - * + * + * * @author Rafael Benevides - * + * */ @RunWith(Arquillian.class) public class ShrinkwrapImportFromPomTest { diff --git a/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAPCVCustomRepoWithoutCentralTest.java b/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAPCVCustomRepoWithoutCentralTest.java index a96207c0a5..81ef0a014e 100644 --- a/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAPCVCustomRepoWithoutCentralTest.java +++ b/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAPCVCustomRepoWithoutCentralTest.java @@ -35,11 +35,11 @@ /** * This test demonstrates how to use Shrinkwrap-resolver to resolve artifacts using G:A:V (GroupId, ArtifactId and Version) and * also shows how to use G:A:P:C:V (GroupId, ArtifactId, Packaging, Classifier and Version) dependencies as a file array. - * + * * The Shrinkwrap-resolver also was customized to use a custom maven settings xml file and disable the Maven Central repository. - * + * * @author Rafael Benevides - * + * */ @RunWith(Arquillian.class) public class ShrinkwrapResolveGAPCVCustomRepoWithoutCentralTest { diff --git a/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAVWithoutTransitiveDepsTest.java b/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAVWithoutTransitiveDepsTest.java index 94dd5679c4..974776aa15 100644 --- a/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAVWithoutTransitiveDepsTest.java +++ b/shrinkwrap-resolver/src/test/java/org/jboss/as/quickstarts/shrinkwrap/resolver/ShrinkwrapResolveGAVWithoutTransitiveDepsTest.java @@ -35,9 +35,9 @@ /** * This test demonstrates how to use Shrinkwrap-resolver to resolve an artifact via G:A:V without transitive dependencies as a * single file - * + * * @author Rafael Benevides - * + * */ @RunWith(Arquillian.class) public class ShrinkwrapResolveGAVWithoutTransitiveDepsTest { diff --git a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/User.java b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/User.java index a97c773111..7e9f28cd98 100644 --- a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/User.java +++ b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/User.java @@ -67,4 +67,4 @@ public void setLastName(String lastName) { this.lastName = lastName; } -} \ No newline at end of file +} diff --git a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDao.java b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDao.java index cc6082067e..24874aa5b7 100644 --- a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDao.java +++ b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDao.java @@ -20,4 +20,4 @@ public interface UserDao { User getForUsername(String username); void createUser(User user); -} \ No newline at end of file +} diff --git a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDaoImpl.java b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDaoImpl.java index 80a36c32d8..6c668af5be 100644 --- a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDaoImpl.java +++ b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/domain/UserDaoImpl.java @@ -47,4 +47,4 @@ public void createUser(User user) { entityManager.persist(user); } -} \ No newline at end of file +} diff --git a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/web/GreetController.java b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/web/GreetController.java index 7d55205635..ebb3d3b519 100644 --- a/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/web/GreetController.java +++ b/spring-greeter/src/main/java/org/jboss/spring/quickstarts/greeter/greeter_spring/web/GreetController.java @@ -50,4 +50,4 @@ String getGreeting(@RequestParam("username") String username) { return "No such user exists! Use 'emuster' or 'jdoe'"; } } -} \ No newline at end of file +} diff --git a/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/controller/MemberController.java b/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/controller/MemberController.java index 7823416801..4b1a07790b 100644 --- a/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/controller/MemberController.java +++ b/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/controller/MemberController.java @@ -69,7 +69,7 @@ public String registerNewMember(@Valid @ModelAttribute("newMember") final Member /** * Checks if a member with the same email address is already registered. This is the only way to easily capture the * "@UniqueConstraint(columnNames = "email")" constraint from the Member class. - * + * * @param email The email to check * @return True if the email already exists, and false otherwise */ diff --git a/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/model/Member.java b/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/model/Member.java index a6a0731229..7025a0f9e7 100644 --- a/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/model/Member.java +++ b/spring-kitchensink-asyncrequestmapping/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/asyncrequestmapping/model/Member.java @@ -92,4 +92,4 @@ public String getPhoneNumber() { public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } -} \ No newline at end of file +} diff --git a/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/controller/MemberController.java b/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/controller/MemberController.java index d50fa051ca..d8907f6fe6 100644 --- a/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/controller/MemberController.java +++ b/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/controller/MemberController.java @@ -69,7 +69,7 @@ public String registerNewMember(@Valid @ModelAttribute("newMember") Member newMe /** * Checks if a member with the same email address is already registered. This is the only way to easily capture the * "@UniqueConstraint(columnNames = "email")" constraint from the Member class. - * + * * @param email The email to check * @return True if the email already exists, and false otherwise */ diff --git a/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/model/Member.java b/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/model/Member.java index 39472af1d8..808537a619 100644 --- a/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/model/Member.java +++ b/spring-kitchensink-basic/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/basic/model/Member.java @@ -92,4 +92,4 @@ public String getPhoneNumber() { public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } -} \ No newline at end of file +} diff --git a/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/controller/MemberController.java b/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/controller/MemberController.java index da69795e51..d2a11d087f 100644 --- a/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/controller/MemberController.java +++ b/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/controller/MemberController.java @@ -86,7 +86,7 @@ public void postError() throws IOException { /** * Checks if a member with the same email address is already registered. This is the only way to easily capture the * "@UniqueConstraint(columnNames = "email")" constraint from the Member class. - * + * * @param email The email to check * @return True if the email already exists, and false otherwise */ diff --git a/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/model/Member.java b/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/model/Member.java index 3f7ce60f6d..e8956508f7 100644 --- a/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/model/Member.java +++ b/spring-kitchensink-controlleradvice/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/controlleradvice/model/Member.java @@ -108,4 +108,4 @@ public Date getDate() { public void setDate(Date date) { this.date = date; } -} \ No newline at end of file +} diff --git a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/config/WebConfig.java b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/config/WebConfig.java index 3c617e526f..39da1c5ff2 100644 --- a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/config/WebConfig.java +++ b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/config/WebConfig.java @@ -29,23 +29,23 @@ public RequestMappingHandlerMapping requestMappingHandlerMapping() { RequestMappingHandlerMapping handlerMapping = super.requestMappingHandlerMapping(); handlerMapping.setRemoveSemicolonContent(false); return handlerMapping; - } - + } + @Bean public RequestMappingHandlerAdapter requestMappingHandlerAdapter() { RequestMappingHandlerAdapter handlerApapter = super.requestMappingHandlerAdapter(); - - /* - * The RequestMappingHandlerAdapter provides a flag called "ignoreDefaultModelOnRedirect" that can be used to indicate - * the content of the default Model should never be used if a controller method redirects. Instead the controller - * method should declare an attribute of type RedirectAttributes or if it doesn't do so no attributes should be - * passed on to RedirectView. Both the MVC namespace and the MVC Java config keep this flag set to false in order + + /* + * The RequestMappingHandlerAdapter provides a flag called "ignoreDefaultModelOnRedirect" that can be used to indicate + * the content of the default Model should never be used if a controller method redirects. Instead the controller + * method should declare an attribute of type RedirectAttributes or if it doesn't do so no attributes should be + * passed on to RedirectView. Both the MVC namespace and the MVC Java config keep this flag set to false in order * to maintain backwards compatibility. However, for new applications we recommend setting it to true. - * - * The use of the redirect in the create Member method will pull in the model from the Filter if run after the - * Filter. This keeps that from happening. + * + * The use of the redirect in the create Member method will pull in the model from the Filter if run after the + * Filter. This keeps that from happening. */ handlerApapter.setIgnoreDefaultModelOnRedirect(true); return handlerApapter; } -} \ No newline at end of file +} diff --git a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/controller/MemberController.java b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/controller/MemberController.java index 32f35967db..2d9f507b5e 100644 --- a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/controller/MemberController.java +++ b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/controller/MemberController.java @@ -46,8 +46,8 @@ public class MemberController { private MemberDao memberDao; /* - * When you go to http://localhost:8080/jboss-spring-kitchensink-matrixvariables/ this method is fired. This is - * because of the class level @RequestMapping(value = "/"). This method does not specify the path and therefore it + * When you go to http://localhost:8080/jboss-spring-kitchensink-matrixvariables/ this method is fired. This is + * because of the class level @RequestMapping(value = "/"). This method does not specify the path and therefore it * runs when you access the root level of the URI. * This method will access DAO to query the database and return all the Members. */ @@ -60,13 +60,13 @@ public String displaySortedMembers(Model model) { return "index"; } - // Note that to enable the use of matrix variables, you must set the removeSemicolonContent property of RequestMappingHandlerMapping - // to false. By default it is set to true with the exception of the MVC namespace and the MVC Java config both of which automatically - // enable the use of matrix variables. + // Note that to enable the use of matrix variables, you must set the removeSemicolonContent property of RequestMappingHandlerMapping + // to false. By default it is set to true with the exception of the MVC namespace and the MVC Java config both of which automatically + // enable the use of matrix variables. // This will allow the Matrix Variables to be passed in because they use semicolons to separate each one. - // This was done by creating a Configuration class and pointing to it in the jboss-as-spring-mvc-context.xml. + // This was done by creating a Configuration class and pointing to it in the jboss-as-spring-mvc-context.xml. @RequestMapping(value = "/mv/{filter}", method = RequestMethod.GET) - public ModelAndView filteredMembers(@MatrixVariable(value = "n", pathVar = "filter", required = false, defaultValue = "") String n, + public ModelAndView filteredMembers(@MatrixVariable(value = "n", pathVar = "filter", required = false, defaultValue = "") String n, @MatrixVariable(value = "e", pathVar = "filter", required = false, defaultValue = "") String e) { log.fine("filteredMembers @MatrixVariable n = " + n + ", e = " + e); ModelAndView model = new ModelAndView("index"); @@ -103,7 +103,7 @@ public String registerNewMember(@Valid @ModelAttribute("newMember") Member newMe /** * Checks if a member with the same email address is already registered. This is the only way to easily capture the * "@UniqueConstraint(columnNames = "email")" constraint from the Member class. - * + * * @param email The email to check * @return True if the email already exists, and false otherwise */ diff --git a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/data/MemberDaoImpl.java b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/data/MemberDaoImpl.java index ad8a5eefc3..1e2898e297 100644 --- a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/data/MemberDaoImpl.java +++ b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/data/MemberDaoImpl.java @@ -35,9 +35,9 @@ @Repository @Transactional public class MemberDaoImpl implements MemberDao { - + private static final Logger log = Logger.getLogger(MemberDaoImpl.class.getName()); - + @Autowired private EntityManager em; @@ -57,12 +57,12 @@ public List findByNameAndEmail(String name, String email) { Predicate isLikeName = cb.like(cb.lower(member.get(type.getDeclaredSingularAttribute("name", String.class))), "%" + name.toLowerCase() + "%"); predicatesList.add(isLikeName); } - // If the email exist create the Predicate for a LIKE comparison of the email. + // If the email exist create the Predicate for a LIKE comparison of the email. if (email != null && !email.isEmpty()) { Predicate isLikeEmail = cb.like(cb.lower(member.get(type.getDeclaredSingularAttribute("email", String.class))), "%" + email.toLowerCase() + "%"); predicatesList.add(isLikeEmail); } - // Add the Predicates to the criteria query. A predicate is utilized for filtering the result only when it is provided. + // Add the Predicates to the criteria query. A predicate is utilized for filtering the result only when it is provided. criteria.where(predicatesList.toArray(new Predicate[predicatesList.size()])); return em.createQuery(criteria).getResultList(); } diff --git a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/model/Member.java b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/model/Member.java index 3e2eeb7d99..9bbc550f6b 100644 --- a/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/model/Member.java +++ b/spring-kitchensink-matrixvariables/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/matrixvariables/model/Member.java @@ -91,4 +91,4 @@ public String getPhoneNumber() { public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } -} \ No newline at end of file +} diff --git a/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/controller/MemberController.java b/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/controller/MemberController.java index 1e9ac1fc48..e01eaf58b5 100644 --- a/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/controller/MemberController.java +++ b/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/controller/MemberController.java @@ -69,7 +69,7 @@ public String registerNewMember(@Valid @ModelAttribute("newMember") Member newMe /** * Checks if a member with the same email address is already registered. This is the only way to easily capture the * "@UniqueConstraint(columnNames = "email")" constraint from the Member class. - * + * * @param email The email to check * @return True if the email already exists, and false otherwise */ diff --git a/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/model/Member.java b/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/model/Member.java index 0797a1f60c..6bdbd2e16e 100644 --- a/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/model/Member.java +++ b/spring-kitchensink-springmvctest/src/main/java/org/jboss/as/quickstarts/kitchensink/spring/springmvctest/model/Member.java @@ -92,4 +92,4 @@ public String getPhoneNumber() { public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } -} \ No newline at end of file +} diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/model/package-info.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/model/package-info.java index 9b2834327c..c34d73a6a0 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/model/package-info.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/model/package-info.java @@ -1,22 +1,22 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * The classes in this package represent PetClinic's business layer. - * - */ -package org.springframework.samples.petclinic.model; - +/* + * Copyright 2002-2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * The classes in this package represent PetClinic's business layer. + * + */ +package org.springframework.samples.petclinic.model; + diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetVisitExtractor.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetVisitExtractor.java index c40786d937..e43f1a3981 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetVisitExtractor.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetVisitExtractor.java @@ -51,4 +51,4 @@ protected Integer mapForeignKey(ResultSet rs) throws SQLException { protected void addChild(JdbcPet root, Visit child) { root.addVisit(child); } -} \ No newline at end of file +} diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/package-info.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/package-info.java index dfa140ca7c..aa6b285d67 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/package-info.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jdbc/package-info.java @@ -1,23 +1,23 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * The classes in this package represent the JDBC implementation - * of PetClinic's persistence layer. - * - */ -package org.springframework.samples.petclinic.repository.jdbc; - +/* + * Copyright 2002-2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * The classes in this package represent the JDBC implementation + * of PetClinic's persistence layer. + * + */ +package org.springframework.samples.petclinic.repository.jdbc; + diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java index c7398df5ba..9a56bca75b 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java @@ -43,7 +43,7 @@ public class JpaOwnerRepositoryImpl implements OwnerRepository { /** - * Important: in the current version of this method, we load Owners with all their Pets and Visits while + * Important: in the current version of this method, we load Owners with all their Pets and Visits while * we do not need Visits at all and we only need one property from the Pet objects (the 'name' property). * There are some ways to improve it such as: * - creating a Ligtweight class (example here: https://community.jboss.org/wiki/LightweightClass) @@ -71,10 +71,10 @@ public Owner findById(int id) { @Override public void save(Owner owner) { if (owner.getId() == null) { - this.em.persist(owner); + this.em.persist(owner); } else { - this.em.merge(owner); + this.em.merge(owner); } } diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java index 84d564da45..7d7d5cc3d1 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java @@ -54,10 +54,10 @@ public Pet findById(int id) { @Override public void save(Pet pet) { if (pet.getId() == null) { - this.em.persist(pet); + this.em.persist(pet); } else { - this.em.merge(pet); + this.em.merge(pet); } } diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java index 3415def96e..40e44a01e8 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java @@ -46,10 +46,10 @@ public class JpaVisitRepositoryImpl implements VisitRepository { @Override public void save(Visit visit) { if (visit.getId() == null) { - this.em.persist(visit); + this.em.persist(visit); } else { - this.em.merge(visit); + this.em.merge(visit); } } diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/package-info.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/package-info.java index 40274a4e9d..39b2c85abb 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/package-info.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/jpa/package-info.java @@ -1,23 +1,23 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * - * The classes in this package represent the JPA implementation - * of PetClinic's persistence layer. - * - */ -package org.springframework.samples.petclinic.repository.jpa; - +/* + * Copyright 2002-2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * The classes in this package represent the JPA implementation + * of PetClinic's persistence layer. + * + */ +package org.springframework.samples.petclinic.repository.jpa; + diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataOwnerRepository.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataOwnerRepository.java index ca1f709f6f..3b55f6dba6 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataOwnerRepository.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataOwnerRepository.java @@ -30,11 +30,11 @@ * @since 15.1.2013 */ public interface SpringDataOwnerRepository extends OwnerRepository, Repository { - + @Override @Query("SELECT DISTINCT owner FROM Owner owner left join fetch owner.pets WHERE owner.lastName LIKE :lastName%") public Collection findByLastName(@Param("lastName") String lastName); - + @Override @Query("SELECT owner FROM Owner owner left join fetch owner.pets WHERE owner.id =:id") public Owner findById(@Param("id") int id); diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/util/CallMonitoringAspect.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/util/CallMonitoringAspect.java index 3c699842f9..f4bbc6406f 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/util/CallMonitoringAspect.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/util/CallMonitoringAspect.java @@ -66,7 +66,7 @@ public int getCallCount() { @ManagedAttribute public long getCallTime() { - if (this.callCount > 0) + if (this.callCount > 0) return this.accumulatedCallTime / this.callCount; else return 0; diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java index c5a3ddba83..bc8c6363a4 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java @@ -107,7 +107,7 @@ else if (results.size() == 1) { return "owners/ownersList"; } } - + @RequestMapping(value = "/owners/{ownerId}/edit", method = RequestMethod.GET) public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model model) { Owner owner = this.clinicService.findOwnerById(ownerId); diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java index 0621c98abb..3144dac1c6 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java @@ -41,12 +41,12 @@ public void validate(Object obj, Errors errors) { } else if (pet.isNew() && pet.getOwner().getPet(name, true) != null) { errors.rejectValue("name", "duplicate", "already exists"); } - + // type validation if (pet.isNew() && pet.getType() == null) { errors.rejectValue("type", "required", "required"); } - + // birth date validation if (pet.getBirthDate()==null) { errors.rejectValue("birthDate", "required", "required"); diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VetController.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VetController.java index ebbb8d6e27..6365fe4581 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VetController.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VetController.java @@ -43,17 +43,17 @@ public VetController(ClinicService clinicService) { @RequestMapping(value={"/vets.xml","/vets.html"}) public String showVetList(Map model) { - // Here we are returning an object of type 'Vets' rather than a collection of Vet objects + // Here we are returning an object of type 'Vets' rather than a collection of Vet objects // so it is simpler for Object-Xml mapping Vets vets = new Vets(); vets.getVetList().addAll(this.clinicService.findVets()); model.put("vets", vets); return "vets/vetList"; } - + @RequestMapping("/vets.json") public @ResponseBody Vets showResourcesVetList() { - // Here we are returning an object of type 'Vets' rather than a collection of Vet objects + // Here we are returning an object of type 'Vets' rather than a collection of Vet objects // so it is simpler for JSon/Object mapping Vets vets = new Vets(); vets.getVetList().addAll(this.clinicService.findVets()); diff --git a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VisitController.java b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VisitController.java index f3f6f3ffb5..faa2ed4873 100644 --- a/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VisitController.java +++ b/spring-petclinic/src/main/java/org/springframework/samples/petclinic/web/VisitController.java @@ -53,12 +53,12 @@ public VisitController(ClinicService clinicService) { public void setAllowedFields(WebDataBinder dataBinder) { dataBinder.setDisallowedFields("id"); } - + /** * Called before each and every @RequestMapping annotated method. * 2 goals: * - Make sure we always have fresh data - * - Since we do not use the session scope, make sure that Pet object always has an id + * - Since we do not use the session scope, make sure that Pet object always has an id * (Even though id is not part of the form fields) * @param petId * @return Pet @@ -67,7 +67,7 @@ public void setAllowedFields(WebDataBinder dataBinder) { public Visit loadPetWithVisit(@PathVariable("petId") int petId) { Pet pet = this.clinicService.findPetById(petId); Visit visit = new Visit(); - pet.addVisit(visit); + pet.addVisit(visit); return visit; } diff --git a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java index f8582b5d9f..d1cf1762b9 100644 --- a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java +++ b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java @@ -13,14 +13,14 @@ import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; /** - * + * * @author Michael Isvy - * Simple test to make sure that Bean Validation is working + * Simple test to make sure that Bean Validation is working * (useful when upgrading to a new version of Hibernate Validator/ Bean Validation) * */ public class ValidatorTests { - + private Validator createValidator() { LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean(); localValidatorFactoryBean.afterPropertiesSet(); @@ -43,5 +43,5 @@ public void shouldNotValidateWhenFirstNameEmpty() { assertThat(violation.getPropertyPath().toString()).isEqualTo("firstName"); assertThat(violation.getMessage()).isEqualTo("may not be empty"); } - + } diff --git a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java index 428c285fd0..f18adf118a 100644 --- a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java +++ b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java @@ -76,7 +76,7 @@ public void shouldFindSingleOwnerWithPet() { public void shouldInsertOwner() { Collection owners = this.clinicService.findOwnerByLastName("Schultz"); int found = owners.size(); - + Owner owner = new Owner(); owner.setFirstName("Sam"); owner.setLastName("Schultz"); @@ -96,7 +96,7 @@ public void shouldUpdateOwner() { Owner owner = this.clinicService.findOwnerById(1); String oldLastName = owner.getLastName(); String newLastName = oldLastName + "X"; - + owner.setLastName(newLastName); this.clinicService.saveOwner(owner); @@ -110,13 +110,13 @@ public void shouldFindPetWithCorrectId() { Pet pet7 = this.clinicService.findPetById(7); assertThat(pet7.getName()).startsWith("Samantha"); assertThat(pet7.getOwner().getFirstName()).isEqualTo("Jean"); - + } @Test public void shouldFindAllPetTypes() { Collection petTypes = this.clinicService.findPetTypes(); - + PetType petType1 = EntityUtils.getById(petTypes, PetType.class, 1); assertThat(petType1.getName()).isEqualTo("cat"); PetType petType4 = EntityUtils.getById(petTypes, PetType.class, 4); @@ -128,7 +128,7 @@ public void shouldFindAllPetTypes() { public void shouldInsertPetIntoDatabaseAndGenerateId() { Owner owner6 = this.clinicService.findOwnerById(6); int found = owner6.getPets().size(); - + Pet pet = new Pet(); pet.setName("bowser"); Collection types = this.clinicService.findPetTypes(); @@ -136,10 +136,10 @@ public void shouldInsertPetIntoDatabaseAndGenerateId() { pet.setBirthDate(new DateTime()); owner6.addPet(pet); assertThat(owner6.getPets().size()).isEqualTo(found + 1); - + this.clinicService.savePet(pet); this.clinicService.saveOwner(owner6); - + owner6 = this.clinicService.findOwnerById(6); assertThat(owner6.getPets().size()).isEqualTo(found + 1); // checks that id has been generated @@ -151,7 +151,7 @@ public void shouldInsertPetIntoDatabaseAndGenerateId() { public void shouldUpdatePetName() throws Exception { Pet pet7 = this.clinicService.findPetById(7); String oldName = pet7.getName(); - + String newName = oldName + "X"; pet7.setName(newName); this.clinicService.savePet(pet7); @@ -163,7 +163,7 @@ public void shouldUpdatePetName() throws Exception { @Test public void shouldFindVets() { Collection vets = this.clinicService.findVets(); - + Vet vet = EntityUtils.getById(vets, Vet.class, 3); assertThat(vet.getLastName()).isEqualTo("Douglas"); assertThat(vet.getNrOfSpecialties()).isEqualTo(2); @@ -178,7 +178,7 @@ public void shouldAddNewVisitForPet() { int found = pet7.getVisits().size(); Visit visit = new Visit(); pet7.addVisit(visit); - visit.setDescription("test"); + visit.setDescription("test"); this.clinicService.saveVisit(visit); this.clinicService.savePet(pet7); diff --git a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java index 49e57ea402..7eaad1e24f 100644 --- a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java +++ b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java @@ -21,7 +21,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** - *

      Integration test using the jdbc profile. + *

      Integration test using the jdbc profile. * @see AbstractClinicServiceTests AbstractClinicServiceTests for more details.

      * * @author Thomas Risberg diff --git a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java index dcf3eead48..5c97acadc4 100644 --- a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java +++ b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java @@ -21,7 +21,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** - *

      Integration test using the jpa profile. + *

      Integration test using the jpa profile. * @see AbstractClinicServiceTests AbstractClinicServiceTests for more details.

      * * @author Rod Johnson @@ -34,4 +34,4 @@ @ActiveProfiles("jpa") public class ClinicServiceJpaTests extends AbstractClinicServiceTests { -} \ No newline at end of file +} diff --git a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java index fb665898c3..216e20fd50 100644 --- a/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java +++ b/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java @@ -21,7 +21,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** - *

      Integration test using the 'Spring Data' profile. + *

      Integration test using the 'Spring Data' profile. * @see AbstractClinicServiceTests AbstractClinicServiceTests for more details.

      * @author Michael Isvy */ @@ -31,4 +31,4 @@ @ActiveProfiles("spring-data-jpa") public class ClinicServiceSpringDataJpaTests extends AbstractClinicServiceTests { -} \ No newline at end of file +} diff --git a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/GreetingBean.java b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/GreetingBean.java index c5261d4de7..db55c9da38 100644 --- a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/GreetingBean.java +++ b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/GreetingBean.java @@ -18,12 +18,12 @@ /** * Basic hello world bean with greeting message - * + * */ public class GreetingBean { private String greeting; - + private final String DEFAULT_NAME = "I'm sorry I don't know your name"; public GreetingBean(String greeting) { diff --git a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java index d1c33400f1..e5e129486f 100644 --- a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java +++ b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java @@ -28,19 +28,19 @@ import org.springframework.beans.factory.annotation.Autowired; /** - * + * * @author Joshua Wilson * */ @Path("/") public class HelloSpringResource { - + @Autowired GreetingBean greetingBean; - + /** * Create a default REST endpoint that directs the user to use the demonstration endpoints. - * + * * @return html */ @GET @@ -59,8 +59,8 @@ public Response getDefault() { System.out.println("getDefault()"); return Response.ok(msg).build(); } - - @GET + + @GET @Path("hello") @Produces("text/plain") public Response sayHello(@QueryParam("name") String name) { @@ -76,7 +76,7 @@ public String getBasic() { System.out.println("getBasic()"); return "basic"; } - + @PUT @Path("basic") @Consumes("text/plain") @@ -104,5 +104,5 @@ public String getMatrixParam(@MatrixParam("param") String param) { public int getUriParam(@PathParam("param") int param) { return param; } - + } diff --git a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/LocatingResource.java b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/LocatingResource.java index 02500d0222..2bd759903f 100644 --- a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/LocatingResource.java +++ b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/LocatingResource.java @@ -33,4 +33,4 @@ public HelloSpringResource getLocating() { System.out.println("Locating Resource..."); return helloSpringResource; } -} \ No newline at end of file +} diff --git a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/Resources.java b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/Resources.java index 07f1a3ac5a..fdea450af4 100644 --- a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/Resources.java +++ b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/Resources.java @@ -30,14 +30,14 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans. As it is a stateful bean, it * can produce extended persistence contexts. - * + * * Example injection on a managed bean field: - * + * * @Inject private EntityManager em; - * + * * @author Pete Muir * @author Lukas Fryc - * + * */ @Stateful @RequestScoped diff --git a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDao.java b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDao.java index 04bd7ed7b5..2faccfff84 100644 --- a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDao.java +++ b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDao.java @@ -22,9 +22,9 @@ /** * Basic operations for manipulation of tasks - * + * * @author Lukas Fryc - * + * */ @Local public interface TaskDao { diff --git a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoImpl.java b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoImpl.java index 91333a1195..c8e17b8d4a 100644 --- a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoImpl.java +++ b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoImpl.java @@ -25,10 +25,10 @@ /** * Provides functionality for manipulation with tasks using the persistence context from {@link Resources}. - * + * * @author Lukas Fryc * @author Oliver Kiss - * + * */ @Stateful public class TaskDaoImpl implements TaskDao { diff --git a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/User.java b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/User.java index 80a05099f4..a33580bf86 100644 --- a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/User.java +++ b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/User.java @@ -31,7 +31,7 @@ /** * User entity - * + * * @author Oliver Kiss */ @SuppressWarnings("serial") diff --git a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDao.java b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDao.java index 1d9b1dea4f..e20b640f83 100644 --- a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDao.java +++ b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDao.java @@ -20,9 +20,9 @@ /** * Basic operations for manipulation with users - * + * * @author Lukas Fryc - * + * */ @Local public interface UserDao { diff --git a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDaoImpl.java b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDaoImpl.java index 3581d8d211..3e610d3910 100644 --- a/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDaoImpl.java +++ b/tasks-jsf/src/main/java/org/jboss/as/quickstarts/tasksJsf/UserDaoImpl.java @@ -24,10 +24,10 @@ /** * Provides functionality for manipulation with users using persistence context from {@link Resources}. - * + * * @author Lukas Fryc * @author Oliver Kiss - * + * */ @Stateful public class UserDaoImpl implements UserDao { diff --git a/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/FacesContextStub.java b/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/FacesContextStub.java index 8e22171429..cc0c1437c7 100644 --- a/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/FacesContextStub.java +++ b/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/FacesContextStub.java @@ -30,9 +30,9 @@ /** * Stub of {@link FacesContext} to allow testing without real JSF session. - * + * * @author Lukas Fryc - * + * */ public class FacesContextStub extends FacesContext { diff --git a/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoStub.java b/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoStub.java index 7292f08c02..15f1a9fd4c 100644 --- a/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoStub.java +++ b/tasks-jsf/src/test/java/org/jboss/as/quickstarts/tasksJsf/TaskDaoStub.java @@ -51,4 +51,4 @@ public void deleteTask(Task task) { public int getGetAllCallsCount() { return getAllCallsCount; } -} \ No newline at end of file +} diff --git a/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/TaskDaoImpl.java b/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/TaskDaoImpl.java index 41fd7135fb..4c23da55b5 100644 --- a/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/TaskDaoImpl.java +++ b/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/TaskDaoImpl.java @@ -78,4 +78,4 @@ public void deleteTask(Task task) { private TypedQuery querySelectAllTasksFromUser(User user) { return em.createQuery("SELECT t FROM Task t WHERE t.owner = ?1", Task.class).setParameter(1, user); } -} \ No newline at end of file +} diff --git a/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/UserDaoImpl.java b/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/UserDaoImpl.java index 4ea428130f..3e0e015a1b 100644 --- a/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/UserDaoImpl.java +++ b/tasks-rs/src/main/java/org/jboss/as/quickstarts/tasksrs/model/UserDaoImpl.java @@ -48,4 +48,4 @@ public User getForUsername(String username) { public void createUser(User user) { em.persist(user); } -} \ No newline at end of file +} diff --git a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Resources.java b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Resources.java index b5f4eb8114..93dea1df46 100644 --- a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Resources.java +++ b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Resources.java @@ -26,11 +26,11 @@ /** * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans. As it is a stateful bean, it * can produce extended persistence contexts. - * + * *

      * Example injection on a managed bean field: *

      - * + * *
        * @Inject
        * private EntityManager em;
      diff --git a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Task.java b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Task.java
      index 06742d71c6..d948d89581 100644
      --- a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Task.java
      +++ b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/Task.java
      @@ -23,7 +23,7 @@
       
       /**
        * User's task entity
      - * 
      + *
        * @author Oliver Kiss
        */
       @SuppressWarnings("serial")
      diff --git a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDao.java b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDao.java
      index b89c3c4fa6..ab84f30d11 100644
      --- a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDao.java
      +++ b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDao.java
      @@ -22,9 +22,9 @@
       
       /**
        * Basic operations for manipulation of tasks
      - * 
      + *
        * @author Lukas Fryc
      - * 
      + *
        */
       @Local
       public interface TaskDao {
      diff --git a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDaoImpl.java b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDaoImpl.java
      index 5eb3534433..98c9c72542 100644
      --- a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDaoImpl.java
      +++ b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/TaskDaoImpl.java
      @@ -25,10 +25,10 @@
       
       /**
        * Provides functionality for manipulation with tasks using the persistence context from {@link Resources}.
      - * 
      + *
        * @author Lukas Fryc
        * @author Oliver Kiss
      - * 
      + *
        */
       @Stateful
       public class TaskDaoImpl implements TaskDao {
      diff --git a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/User.java b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/User.java
      index 5de5994a63..927f4f1bba 100644
      --- a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/User.java
      +++ b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/User.java
      @@ -26,7 +26,7 @@
       
       /**
        * User entity
      - * 
      + *
        * @author Oliver Kiss
        */
       @SuppressWarnings("serial")
      diff --git a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDao.java b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDao.java
      index 9eb854a9b2..3650f7c4ed 100644
      --- a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDao.java
      +++ b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDao.java
      @@ -20,9 +20,9 @@
       
       /**
        * Basic operations for manipulation with users
      - * 
      + *
        * @author Lukas Fryc
      - * 
      + *
        */
       @Local
       public interface UserDao {
      diff --git a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDaoImpl.java b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDaoImpl.java
      index 22f86b1931..148e16b7a8 100644
      --- a/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDaoImpl.java
      +++ b/tasks/src/main/java/org/jboss/as/quickstarts/tasks/UserDaoImpl.java
      @@ -24,10 +24,10 @@
       
       /**
        * Provides functionality for manipulation with users using persistence context from {@link Resources}.
      - * 
      + *
        * @author Lukas Fryc
        * @author Oliver Kiss
      - * 
      + *
        */
       @Stateful
       public class UserDaoImpl implements UserDao {
      diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java
      index ae38404067..c7d295d787 100644
      --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java
      +++ b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java
      @@ -25,9 +25,9 @@
       
       /**
        * A JSF converter that can handle the {@link Scale} enum.
      - * 
      + *
        * @author Pete Muir
      - * 
      + *
        */
       @Named
       public class ScaleConverter implements Converter {
      diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java
      index 4e22cde300..a76b9f18fc 100644
      --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java
      +++ b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java
      @@ -31,9 +31,9 @@
       /**
        * A simple managed bean that is used to invoke the TemperatureConvertEJB and store the response. The response is obtained by
        * invoking temperatureConvertEJB.convert().
      - * 
      + *
        * Code borrowed and modified from another quickstart written by Paul Robinson
      - * 
      + *
        * @author Bruce Wolfe
        */
       @SuppressWarnings("serial")
      @@ -58,7 +58,7 @@ public class TemperatureConverter implements Serializable {
       
           /**
            * Invoke temperatureConvertEJB.convert() and store the temperature
      -     * 
      +     *
            * @param sourceTemperature The temperature to be converted
            * @param defaultScale The default source temperature scale
            */
      diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java
      index 9450e45997..4bab9e95ac 100644
      --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java
      +++ b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java
      @@ -18,9 +18,9 @@
       
       /**
        * The temperature scale.
      - * 
      + *
        * @author Pete Muir
      - * 
      + *
        */
       public enum Scale {
       
      @@ -30,7 +30,7 @@ public enum Scale {
       
           /**
            * Constructor for a scale, taking the symbol used to represent the temperature scale.
      -     * 
      +     *
            * @param symbol
            */
           private Scale(String symbol) {
      diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java
      index 541447d396..f1c94c11c2 100644
      --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java
      +++ b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java
      @@ -22,10 +22,10 @@
       
       /**
        * A domain object that can store a temperature and scale. Additionally, it can parse a string to a temperature and scale.
      - * 
      + *
        * @author Pete Muir
        * @author Bruce Wolfe
      - * 
      + *
        */
       public class Temperature {
       
      @@ -39,7 +39,7 @@ public class Temperature {
       
           /**
            * Parse a string, with an optional scale suffix. If no scale suffix is on the string, the defaultScale will be used.
      -     * 
      +     *
            * @param temperature the temperature to parse
            * @param defaultScale the default scale to use
            */
      diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java
      index 870bf45e35..9375605087 100644
      --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java
      +++ b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java
      @@ -25,7 +25,7 @@
       
       /**
        * A simple SLSB EJB. The EJB does not use an interface.
      - * 
      + *
        * @author Bruce Wolfe
        */
       @Stateless
      @@ -33,7 +33,7 @@ public class TemperatureConvertEJB {
       
           /**
            * This method takes a temperature in Celsius or Fahrenheit and converts it to the other value.
      -     * 
      +     *
            * @param source the temperature to convert from
            * @return the converted temperature.
            */
      diff --git a/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/BidWebSocketEndpoint.java b/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/BidWebSocketEndpoint.java
      index 0dee3f9e6c..84fc76a4a3 100644
      --- a/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/BidWebSocketEndpoint.java
      +++ b/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/BidWebSocketEndpoint.java
      @@ -38,11 +38,11 @@
       /**
        * WebSocket server endpoint example
        * 

      - * + * * This class produces a Websocket endpoint to receive messages from clients. - * + * * @author Rafael Benevides - * + * */ @ServerEndpoint(value = "/bidsocket", encoders = { BiddingEncoder.class }, decoders = { MessageDecoder.class }) public class BidWebSocketEndpoint { diff --git a/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/MessageDecoder.java b/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/MessageDecoder.java index bb60e9c6e7..c63d4016ad 100644 --- a/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/MessageDecoder.java +++ b/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/MessageDecoder.java @@ -26,8 +26,8 @@ import javax.websocket.Decoder; import javax.websocket.EndpointConfig; -// This class is responsible to "decode" the received String -// from clients in a Message object +// This class is responsible to "decode" the received String +// from clients in a Message object public class MessageDecoder implements Decoder.Text { private Logger logger = Logger.getLogger(getClass().getName()); diff --git a/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/model/Item.java b/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/model/Item.java index e39fbc2b84..6e07269407 100644 --- a/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/model/Item.java +++ b/websocket-endpoint/src/main/java/org/jboss/quickstarts/websocket/model/Item.java @@ -16,7 +16,7 @@ */ package org.jboss.quickstarts.websocket.model; -//This class represents a Item that is being offered +//This class represents a Item that is being offered public class Item { private String title; diff --git a/websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java b/websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java index 0fcb6d34e5..9b96cd4307 100644 --- a/websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java +++ b/websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java @@ -36,7 +36,7 @@ public String sayHello(String name) { public void helloOnOpen(Session session) { System.out.println("WebSocket opened: " + session.getId()); } - + @OnClose public void helloOnClose(CloseReason reason) { System.out.println("WebSocket connection closed with CloseCode: " + reason.getCloseCode()); diff --git a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/MockRestaurantManager.java b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/MockRestaurantManager.java index 094cb354c9..287edb846f 100644 --- a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/MockRestaurantManager.java +++ b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/MockRestaurantManager.java @@ -20,9 +20,9 @@ /** * This class represents the back-end resource for managing Restaurant bookings. - * + * * This is a mock implementation that just keeps a counter of how many bookings have been made. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ public class MockRestaurantManager { @@ -35,7 +35,7 @@ public class MockRestaurantManager { /** * Accessor to obtain the singleton restaurant manager instance. - * + * * @return the singleton RestaurantManager instance. */ public synchronized static MockRestaurantManager getSingletonInstance() { @@ -48,7 +48,7 @@ public synchronized static MockRestaurantManager getSingletonInstance() { /** * Make a booking with the restaurant. - * + * * @param txID The transaction identifier */ public synchronized void makeBooking(Object txID) { @@ -58,7 +58,7 @@ public synchronized void makeBooking(Object txID) { /** * Prepare local state changes for the supplied transaction. This method should persist any required information to ensure * that it can undo (rollback) or make permanent (commit) the work done inside this transaction, when told to do so. - * + * * @param txID The transaction identifier * @return true on success, false otherwise */ @@ -69,7 +69,7 @@ public boolean prepare(Object txID) { /** * commit local state changes for the supplied transaction - * + * * @param txID The transaction identifier */ public void commit(Object txID) { @@ -79,7 +79,7 @@ public void commit(Object txID) { /** * roll back local state changes for the supplied transaction - * + * * @param txID The transaction identifier */ public void rollback(Object txID) { @@ -88,7 +88,7 @@ public void rollback(Object txID) { /** * Returns the number of bookings - * + * * @return the number of bookings. */ public int getBookingCount() { diff --git a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantParticipant.java b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantParticipant.java index 4016681e7f..eafb2112f6 100644 --- a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantParticipant.java +++ b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantParticipant.java @@ -22,7 +22,7 @@ /** * An adapter class that exposes the RestaurantManager as a WS-T Atomic Transaction participant. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ public class RestaurantParticipant implements Durable2PCParticipant, Serializable { @@ -36,7 +36,7 @@ public class RestaurantParticipant implements Durable2PCParticipant, Serializabl /** * Creates a new participant for this transaction. Participants and transaction instances have a one-to-one mapping. - * + * * @param txID the ID of the transaction tht this participant will be enlisted within. */ public RestaurantParticipant(String txID) { @@ -45,7 +45,7 @@ public RestaurantParticipant(String txID) { /** * Invokes the prepare step of the business logic, reporting activity and outcome. - * + * * @return Prepared where possible, Aborted where necessary. * @throws WrongStateException * @throws SystemException @@ -69,7 +69,7 @@ public Vote prepare() throws WrongStateException, SystemException { /** * Invokes the commit step of the business logic. - * + * * @throws WrongStateException * @throws SystemException */ @@ -82,7 +82,7 @@ public void commit() throws WrongStateException, SystemException { /** * Invokes the rollback operation on the business logic. - * + * * @throws WrongStateException * @throws SystemException */ diff --git a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantServiceATImpl.java b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantServiceATImpl.java index 0aa3667599..89562be0a7 100644 --- a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantServiceATImpl.java +++ b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/RestaurantServiceATImpl.java @@ -31,9 +31,9 @@ /** * An adapter class that exposes the RestaurantManager business API as a transactional Web Service. - * + * * @author paul.robinson@redhat.com, 2012-01-04 - * + * */ @WebService(serviceName = "RestaurantServiceATService", portName = "RestaurantServiceAT", name = "RestaurantServiceAT", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/wsat/simple/Restaurant") @HandlerChain(file = "/context-handlers.xml", name = "Context Handlers") @@ -71,7 +71,7 @@ public void makeBooking() throws RestaurantException { /** * obtain the number of existing bookings - * + * * @return the number of current bookings */ @Override @@ -81,7 +81,7 @@ public int getBookingCount() { /** * Reset the booking count to zero - * + * * Note: To simplify this example, this method is not part of the compensation logic, so will not be undone if the AT is * compensated. It can also be invoked outside of an active AT. */ diff --git a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceAT.java b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceAT.java index b8d81b1fe6..a3b557dfac 100644 --- a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceAT.java +++ b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceAT.java @@ -23,7 +23,7 @@ /** * Interface to a simple Restaurant. Provides simple methods to manipulate bookings. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @WebService(name = "RestaurantServiceAT", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/wsat/simple/Restaurant") @@ -38,7 +38,7 @@ public interface RestaurantServiceAT { /** * obtain the number of existing bookings - * + * * @return the number of current bookings */ @WebMethod diff --git a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceATService.java b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceATService.java index 4af8b27dee..1665aede51 100644 --- a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceATService.java +++ b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/jaxws/RestaurantServiceATService.java @@ -28,7 +28,7 @@ /** * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated source version: 2.1 - * + * */ @WebServiceClient(name = "RestaurantServiceATService", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/wsat/simple/Restaurant") public class RestaurantServiceATService extends Service { @@ -59,7 +59,7 @@ public RestaurantServiceATService() { } /** - * + * * @return returns RestaurantServiceAT */ @WebEndpoint(name = "RestaurantServiceAT") @@ -69,7 +69,7 @@ public RestaurantServiceAT getRestaurantServiceAT() { } /** - * + * * @param features A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the * features parameter will have their default values. * @return returns RestaurantServiceAT diff --git a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/servlet/WSATSimpleServletClient.java b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/servlet/WSATSimpleServletClient.java index bb7e11b8c5..016c2b3f12 100644 --- a/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/servlet/WSATSimpleServletClient.java +++ b/wsat-simple/src/main/java/org/jboss/as/quickstarts/wsat/simple/servlet/WSATSimpleServletClient.java @@ -1,132 +1,132 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.wsat.simple.servlet; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.ws.BindingProvider; -import javax.xml.ws.WebServiceRef; -import javax.xml.ws.handler.Handler; - -import org.jboss.as.quickstarts.wsat.simple.jaxws.RestaurantServiceAT; -import org.jboss.as.quickstarts.wsat.simple.jaxws.RestaurantServiceATService; - -import com.arjuna.mw.wst11.UserTransaction; -import com.arjuna.mw.wst11.UserTransactionFactory; -import com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor; - -/** - *

      - * A simple servlet 3 that begins a WS-AtomicTransaction and invokes a Web service. If the call is successful, the transaction - * is committed. - *

      - *

      - *

      - * The servlet is registered and mapped to /WSATSimpleServletClient using the {@linkplain javax.servlet.annotation.WebServlet} - * - * @author Paul Robinson (paul.robinson@redhat.com) - * @HttpServlet . - *

      - */ -@WebServlet("/WSATSimpleServletClient") -public class WSATSimpleServletClient extends HttpServlet { - - private static final long serialVersionUID = -8314035702649252239L; - - @WebServiceRef(value = RestaurantServiceATService.class) - private RestaurantServiceAT client; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - /* - * Add client handler chain - */ - BindingProvider bindingProvider = (BindingProvider) client; - @SuppressWarnings("rawtypes") - List handlers = new ArrayList<>(1); - handlers.add(new JaxWSHeaderContextProcessor()); - bindingProvider.getBinding().setHandlerChain(handlers); - - /* - * Lookup the DNS name of the server from the environment and set the endpoint address on the client. - */ - String openshift = System.getenv("OPENSHIFT_APP_DNS"); - if (openshift != null) { - bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, - "http://" + openshift + "/RestaurantServiceAT"); - } - - resp.setContentType("text/html"); - PrintWriter out = resp.getWriter(); - - out.write("

      Quickstart: This example demonstrates the deployment of a WS-AT (WS-AtomicTransaction) enabled JAX-WS Web service bundled in a war archive for deployment to *Red Hat JBoss Enterprise Application Platform*.

      "); - - System.out.println("[CLIENT] Creating a new WS-AT User Transaction"); - UserTransaction ut = UserTransactionFactory.userTransaction(); - try { - System.out - .println("[CLIENT] Beginning Atomic Transaction (All calls to Web services that support WS-AT wil be included in this transaction)"); - ut.begin(); - System.out.println("[CLIENT] invoking makeBooking() on WS"); - client.makeBooking(); - System.out.println("[CLIENT] committing Atomic Transaction (This will cause the AT to complete successfully)"); - ut.commit(); - - out.write("

      Transaction succeeded!

      "); - - } catch (Exception e) { - e.printStackTrace(); - - out.write("

      Transaction failed with the following error:

      "); - out.write("

      "); - out.write(e.toString()); - out.write("

      "); - } finally { - rollbackIfActive(ut); - client.reset(); - - out.write("

      Go to your JBoss EAP Server console or log to see the detailed result of the transaction.

      "); - } - } - - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - doGet(req, resp); - } - - /** - * Utility method for rolling back a transaction if it is currently active. - * - * @param ut The User Business Activity to cancel. - */ - private void rollbackIfActive(UserTransaction ut) { - try { - ut.rollback(); - } catch (Throwable th2) { - // do nothing, not active - } - } - -} +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.wsat.simple.servlet; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.xml.ws.BindingProvider; +import javax.xml.ws.WebServiceRef; +import javax.xml.ws.handler.Handler; + +import org.jboss.as.quickstarts.wsat.simple.jaxws.RestaurantServiceAT; +import org.jboss.as.quickstarts.wsat.simple.jaxws.RestaurantServiceATService; + +import com.arjuna.mw.wst11.UserTransaction; +import com.arjuna.mw.wst11.UserTransactionFactory; +import com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor; + +/** + *

      + * A simple servlet 3 that begins a WS-AtomicTransaction and invokes a Web service. If the call is successful, the transaction + * is committed. + *

      + *

      + *

      + * The servlet is registered and mapped to /WSATSimpleServletClient using the {@linkplain javax.servlet.annotation.WebServlet} + * + * @author Paul Robinson (paul.robinson@redhat.com) + * @HttpServlet . + *

      + */ +@WebServlet("/WSATSimpleServletClient") +public class WSATSimpleServletClient extends HttpServlet { + + private static final long serialVersionUID = -8314035702649252239L; + + @WebServiceRef(value = RestaurantServiceATService.class) + private RestaurantServiceAT client; + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + /* + * Add client handler chain + */ + BindingProvider bindingProvider = (BindingProvider) client; + @SuppressWarnings("rawtypes") + List handlers = new ArrayList<>(1); + handlers.add(new JaxWSHeaderContextProcessor()); + bindingProvider.getBinding().setHandlerChain(handlers); + + /* + * Lookup the DNS name of the server from the environment and set the endpoint address on the client. + */ + String openshift = System.getenv("OPENSHIFT_APP_DNS"); + if (openshift != null) { + bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, + "http://" + openshift + "/RestaurantServiceAT"); + } + + resp.setContentType("text/html"); + PrintWriter out = resp.getWriter(); + + out.write("

      Quickstart: This example demonstrates the deployment of a WS-AT (WS-AtomicTransaction) enabled JAX-WS Web service bundled in a war archive for deployment to *Red Hat JBoss Enterprise Application Platform*.

      "); + + System.out.println("[CLIENT] Creating a new WS-AT User Transaction"); + UserTransaction ut = UserTransactionFactory.userTransaction(); + try { + System.out + .println("[CLIENT] Beginning Atomic Transaction (All calls to Web services that support WS-AT wil be included in this transaction)"); + ut.begin(); + System.out.println("[CLIENT] invoking makeBooking() on WS"); + client.makeBooking(); + System.out.println("[CLIENT] committing Atomic Transaction (This will cause the AT to complete successfully)"); + ut.commit(); + + out.write("

      Transaction succeeded!

      "); + + } catch (Exception e) { + e.printStackTrace(); + + out.write("

      Transaction failed with the following error:

      "); + out.write("

      "); + out.write(e.toString()); + out.write("

      "); + } finally { + rollbackIfActive(ut); + client.reset(); + + out.write("

      Go to your JBoss EAP Server console or log to see the detailed result of the transaction.

      "); + } + } + + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + doGet(req, resp); + } + + /** + * Utility method for rolling back a transaction if it is currently active. + * + * @param ut The User Business Activity to cancel. + */ + private void rollbackIfActive(UserTransaction ut) { + try { + ut.rollback(); + } catch (Throwable th2) { + // do nothing, not active + } + } + +} diff --git a/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/Client.java b/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/Client.java index dfaf01a8fc..ee629824f5 100644 --- a/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/Client.java +++ b/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/Client.java @@ -32,7 +32,7 @@ /** * A Client stub to the restaurant service. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @ClientStub @@ -42,7 +42,7 @@ public class Client implements RestaurantServiceAT { /** * Default constructor with hard-coded values for the RestaurantServiceAT endpoint details (wsdl url, service name & port * name) - * + * * @throws MalformedURLException if the WSDL url is malformed. */ public Client() throws MalformedURLException { @@ -75,7 +75,7 @@ public void makeBooking() throws RestaurantException { /** * obtain the number of existing bookings - * + * * @return the number of current bookings */ @Override diff --git a/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientStub.java b/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientStub.java index 7ed8ea526c..0930633be5 100644 --- a/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientStub.java +++ b/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientStub.java @@ -29,10 +29,10 @@ /** * Qualifier for specifying which RestaurantServiceAT implementation to use. - * + * * This Qualifier only supports the ClientStub implementation. The only other class to implement RestaurantServiceAT is the * RestaurantServiceATImpl class, which is not injected by CDI, so does not require Qualifier support. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @Qualifier diff --git a/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientTest.java b/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientTest.java index e73e4e70ea..82613469cc 100644 --- a/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientTest.java +++ b/wsat-simple/src/test/java/org/jboss/as/quickstarts/wsat/simple/ClientTest.java @@ -35,7 +35,7 @@ /** * Simple set of tests for the RestaurantServiceAT - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @RunWith(Arquillian.class) @@ -50,7 +50,7 @@ public class ClientTest { /** * Create the deployment archive to be deployed by Arquillian. - * + * * @return a WebArchive representing the required deployment */ @Deployment @@ -64,7 +64,7 @@ public static WebArchive createTestArchive() { /** * Test the simple scenario where a booking is made and then committed. - * + * * @throws Exception if something goes wrong. */ @Test @@ -94,7 +94,7 @@ public void testCommit() throws Exception { /** * Tests the scenario where a booking is made and the transaction is later rolledback. - * + * * @throws Exception if something goes wrong */ @Test @@ -125,7 +125,7 @@ public void testRollback() throws Exception { /** * Utility method for rolling back a transaction if it is currently active. - * + * * @param ut The User Business Activity to cancel. */ private void rollbackIfActive(UserTransaction ut) { diff --git a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/AlreadyInSetException.java b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/AlreadyInSetException.java index 2aef1126c4..8f5e70b86a 100644 --- a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/AlreadyInSetException.java +++ b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/AlreadyInSetException.java @@ -18,7 +18,7 @@ /** * This Exception is thrown when an add of an already existing item is attempted on the set. - * + * * @author paul.robinson@redhat.com, 2011-12-21 */ public class AlreadyInSetException extends Exception { diff --git a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/MockSetManager.java b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/MockSetManager.java index 3a5692f2ec..6ecdd2036b 100644 --- a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/MockSetManager.java +++ b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/MockSetManager.java @@ -21,12 +21,12 @@ /** * This class represents a simple Set collection. - * + * * It is beyond the scope of this quickstart to provide a full bullet-proof implementation of a Resource Manager. Therefore a * simple Mock implementation is provided. - * + * * You should refer to the XTS demo project, shipped as part of the JBossTS project, for a more complete example. - * + * * @author paul.robinson@redhat.com, 2011-12-21 */ public class MockSetManager { @@ -35,7 +35,7 @@ public class MockSetManager { /** * Add a value to the set - * + * * @param item Item to add to the set. * @throws AlreadyInSetException if the item is already in the set. */ @@ -52,9 +52,9 @@ public static void add(String item) throws AlreadyInSetException { /** * Persist sufficient data, such that the add operation can be undone or made permanent when told to do so by a call to * commit or rollback. - * + * * As this is a mock implementation, the method does nothing and always returns true. - * + * * @return true if the SetManager is able to commit and the required state was persisted. False otherwise. */ public static boolean prepare() { @@ -63,7 +63,7 @@ public static boolean prepare() { /** * Make the outcome of the add operation permanent. - * + * * As this is a mock implementation, the method does nothing. */ public static void commit() { @@ -73,10 +73,10 @@ public static void commit() { /** * Undo any changes made by the add operation. - * + * * As this is a mock implementation, the method needs to be informed of how to undo the work of the add operation. Typically * resource managers will already know this information. - * + * * @param item The item to remove from the set in order to undo the effects of the add operation. */ public static void rollback(String item) { @@ -91,7 +91,7 @@ public static void rollback(String item) { /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetParticipantBA.java b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetParticipantBA.java index 97222e91f0..4fe2da4afe 100644 --- a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetParticipantBA.java +++ b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetParticipantBA.java @@ -35,7 +35,7 @@ * coordinator to tell it to complete. This has the advantage that the client can continue calling methods on the service right * up until it calls 'close'. However, any resources held by the service need to be held for this duration, unless the service * decides to autonomously cancel the BA. - * + * * @author Paul Robinson (paul.robinson@redhat.com) */ public class SetParticipantBA implements BusinessAgreementWithCoordinatorCompletionParticipant, ConfirmCompletedParticipant, @@ -51,7 +51,7 @@ public class SetParticipantBA implements BusinessAgreementWithCoordinatorComplet /** * Participant instances are related to business method calls in a one to one manner. - * + * * @param txID The ID of the current Business Activity * @param value the value to remove from the set during compensation */ @@ -62,7 +62,7 @@ public SetParticipantBA(String txID, String value) { /** * Notify the participant that another value is being added to the set. This is stored in case compensation is required. - * + * * @param value the value being added to the set */ public void addValue(String value) { @@ -72,7 +72,7 @@ public void addValue(String value) { /** * The transaction has completed successfully. The participant previously informed the coordinator that it was ready to * complete. - * + * * @throws WrongStateException never in this implementation. * @throws SystemException never in this implementation. */ @@ -86,7 +86,7 @@ public void close() throws WrongStateException, SystemException { /** * The transaction has canceled, and the participant should undo any work. The participant cannot have informed the * coordinator that it has completed. - * + * * @throws WrongStateException never in this implementation. * @throws SystemException never in this implementation. */ @@ -99,7 +99,7 @@ public void cancel() throws WrongStateException, SystemException { /** * The transaction has cancelled. The participant previously informed the coordinator that it had finished work but could * compensate later if required, and it is now requested to do so. - * + * * @throws WrongStateException never in this implementation. * @throws SystemException if unable to perform the compensating transaction. */ @@ -139,7 +139,7 @@ public void complete() throws WrongStateException, SystemException { /** * method called to perform commit or rollback of prepared changes to the underlying manager state after the participant * recovery record has been written - * + * * @param confirmed true if the log record has been written and changes should be rolled forward and false if it has not * been written and changes should be rolled back */ @@ -160,7 +160,7 @@ public void confirmCompleted(boolean confirmed) { /************************************************************************/ /** * keep track of a participant - * + * * @param txID the participant's transaction id * @param participant The participant associated with this BA */ @@ -170,7 +170,7 @@ public static synchronized void recordParticipant(String txID, SetParticipantBA /** * forget about a participant - * + * * @param txID the participant's transaction id */ public static void removeParticipant(String txID) { @@ -179,7 +179,7 @@ public static void removeParticipant(String txID) { /** * lookup a participant - * + * * @param txID the participant's transaction id * @return the participant */ diff --git a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceBAImpl.java b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceBAImpl.java index 8b463f08fb..ecf838e6da 100644 --- a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceBAImpl.java +++ b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceBAImpl.java @@ -29,7 +29,7 @@ /** * An adapter class that exposes a set as a transactional Web Service. - * + * * @author Paul Robinson (paul.robinson@redhat.com) */ @WebService(serviceName = "SetServiceBAService", portName = "SetServiceBA", name = "SetServiceBA", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/helloworld/wsba/coordinatorcompletion/set") @@ -39,7 +39,7 @@ public class SetServiceBAImpl implements SetServiceBA { /** * Add an item to a set and enroll a Participant if necessary then pass the call through to the business logic. - * + * * @param value the value to add to the set. * @throws AlreadyInSetException if value is already in the set * @throws SetServiceException if an error occurred when attempting to add the item to the set. @@ -91,7 +91,7 @@ public void addValueToSet(String value) throws AlreadyInSetException, SetService /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceException.java b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceException.java index 6857f30b34..db2dd4bf5e 100644 --- a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceException.java +++ b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/SetServiceException.java @@ -18,7 +18,7 @@ /** * Exception used to communicate a general error in the SetService. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ public class SetServiceException extends Exception { diff --git a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBA.java b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBA.java index b3ebacba3e..90a32abe00 100644 --- a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBA.java +++ b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBA.java @@ -25,9 +25,9 @@ /** * Interface implemented by SetServiceBA Web service and Client stub. - * + * * The Web service represents a simple set collection and this interface provides the basic methods for accessing it. - * + * * @author paul.robinson@redhat.com, 2011-12-21 */ @WebService(name = "SetServiceBA", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/helloworld/wsba/coordinatorcompletion/set") @@ -36,7 +36,7 @@ public interface SetServiceBA { /** * Add a value to the set - * + * * @param value Value to add to the set. * @throws AlreadyInSetException if the item is already in the set. * @throws SetServiceException if an error occurred during the adding of the item to the set. @@ -46,7 +46,7 @@ public interface SetServiceBA { /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBAService.java b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBAService.java index 31dabbf77e..bd7692c2e7 100644 --- a/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBAService.java +++ b/wsba-coordinator-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/jaxws/SetServiceBAService.java @@ -27,7 +27,7 @@ /** * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.2-hudson-182-RC1 Generated source version: 2.0 - * + * */ @WebServiceClient(name = "SetServiceBAService", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/helloworld/wsba/coordinatorcompletion/set") public class SetServiceBAService extends Service { @@ -58,7 +58,7 @@ public SetServiceBAService() { } /** - * + * * @return returns ISetServiceBA */ @WebEndpoint(name = "SetServiceBA") diff --git a/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/Client.java b/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/Client.java index d9c7d7412d..c9cc268ea0 100644 --- a/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/Client.java +++ b/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/Client.java @@ -32,7 +32,7 @@ /** * A Client stub to the SetService. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @ClientStub @@ -41,7 +41,7 @@ public class Client implements SetServiceBA { /** * Default constructor with hard-coded values for the SetService endpoint details (wsdl url, service name & port name) - * + * * @throws MalformedURLException if the WSDL url is malformed. */ public Client() throws MalformedURLException { @@ -66,7 +66,7 @@ public Client() throws MalformedURLException { /** * Add a value to the set - * + * * @param value Value to add to the set. * @throws AlreadyInSetException if the item is already in the set. * @throws SetServiceException if an error occurred during the adding of the item to the set. @@ -77,7 +77,7 @@ public void addValueToSet(String value) throws AlreadyInSetException, SetService /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientStub.java b/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientStub.java index 1e5deee352..61f174e529 100644 --- a/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientStub.java +++ b/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientStub.java @@ -29,10 +29,10 @@ /** * Qualifier for specifying which SetServiceBA implementation to use. - * + * * This Qualifier only supports the ClientStub implementation. The other class to implement SetServiceBA is the SetServiceBAImpl * class, which is not injected by CDI, so does not require Qualifier support. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @Qualifier diff --git a/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientTest.java b/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientTest.java index 5bf800b5a1..d36ec90bf7 100644 --- a/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientTest.java +++ b/wsba-coordinator-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/coordinatorcompletion/simple/ClientTest.java @@ -33,10 +33,10 @@ @RunWith(Arquillian.class) public class ClientTest { - + private static String ManifestMF = "Manifest-Version: 1.0\n" + "Dependencies: org.jboss.xts\n"; - + @Inject @ClientStub public SetServiceBA client; @@ -52,7 +52,7 @@ public static WebArchive createTestArchive() { /** * Test the simple scenario where an item is added to the set within a Business Activity which is closed successfully. - * + * * @throws Exception if something goes wrong. */ @Test @@ -91,7 +91,7 @@ public void testSuccess() throws Exception { * Tests the scenario where an item is added to the set with in a business activity that is later cancelled. The test checks * that the item is in the set after invoking addValueToSet on the Web service. After cancelling the Business Activity, the * work should be compensated and thus the item should no longer be in the set. - * + * * @throws Exception if something goes wrong */ @Test @@ -132,7 +132,7 @@ public void testCancel() throws Exception { /** * Utility method for cancelling a Business Activity if it is currently active. - * + * * @param uba The User Business Activity to cancel. */ private void cancelIfActive(UserBusinessActivity uba) { diff --git a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/AlreadyInSetException.java b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/AlreadyInSetException.java index 6af9c8ada3..2f32f2fd65 100644 --- a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/AlreadyInSetException.java +++ b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/AlreadyInSetException.java @@ -18,7 +18,7 @@ /** * This Exception is thrown when an add of an already existing item is attempted on the set. - * + * * @author paul.robinson@redhat.com, 2011-12-21 */ public class AlreadyInSetException extends Exception { diff --git a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/MockSetManager.java b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/MockSetManager.java index b4c8c900c4..b4b9aab41d 100644 --- a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/MockSetManager.java +++ b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/MockSetManager.java @@ -21,12 +21,12 @@ /** * This class represents a simple Set collection. - * + * * It is beyond the scope of this quickstart to provide a full bullet-proof implementation of a Resource Manager. Therefore a * simple Mock implementation is provided. - * + * * You should refer to the XTS demo project, shipped as part of the JBossTS project, for a more complete example. - * + * * @author paul.robinson@redhat.com, 2011-12-21 */ public class MockSetManager { @@ -35,7 +35,7 @@ public class MockSetManager { /** * Add a value to the set - * + * * @param item Item to add to the set. * @throws AlreadyInSetException if the item is already in the set. */ @@ -52,9 +52,9 @@ public static void add(String item) throws AlreadyInSetException { /** * Persist sufficient data, such that the add operation can be undone or made permanent when told to do so by a call to * commit or rollback. - * + * * As this is a mock implementation, the method does nothing and always returns true. - * + * * @return true if the SetManager is able to commit and the required state was persisted. False otherwise. */ public static boolean prepare() { @@ -63,7 +63,7 @@ public static boolean prepare() { /** * Make the outcome of the add operation permanent. - * + * * As this is a mock implementation, the method does nothing. */ public static void commit() { @@ -73,10 +73,10 @@ public static void commit() { /** * Undo any changes made by the add operation. - * + * * As this is a mock implementation, the method needs to be informed of how to undo the work of the add operation. Typically * resource managers will already know this information. - * + * * @param item The item to remove from the set in order to undo the effects of the add operation. */ public static void rollback(String item) { @@ -91,7 +91,7 @@ public static void rollback(String item) { /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetParticipantBA.java b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetParticipantBA.java index 3dd4969c60..fac36cd9d6 100644 --- a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetParticipantBA.java +++ b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetParticipantBA.java @@ -26,11 +26,11 @@ /** * An adapter class that exposes the SetManager as a WS-BA participant using the 'Participant Completion' protocol. - * + * * The Set Service only allows a single item to be added to the set in any given transaction. So, this means it can complete at * the end of the addValueToSet call, rather than having to wait for the coordinator to tell it to do so. Hence it uses a * participant which implements the 'participant completion' protocol. - * + * * @author Paul Robinson (paul.robinson@redhat.com) */ public class SetParticipantBA implements BusinessAgreementWithParticipantCompletionParticipant, ConfirmCompletedParticipant, @@ -42,7 +42,7 @@ public class SetParticipantBA implements BusinessAgreementWithParticipantComplet /** * Participant instances are related to business method calls in a one to one manner. - * + * * @param value the value to remove from the set during compensation */ public SetParticipantBA(String value) { @@ -52,7 +52,7 @@ public SetParticipantBA(String value) { /** * The transaction has completed successfully. The participant previously informed the coordinator that it was ready to * complete. - * + * * @throws WrongStateException never in this implementation. * @throws SystemException never in this implementation. */ @@ -66,7 +66,7 @@ public void close() throws WrongStateException, SystemException { /** * The transaction has canceled, and the participant should undo any work. The participant cannot have informed the * coordinator that it has completed. - * + * * @throws WrongStateException never in this implementation. * @throws SystemException never in this implementation. */ @@ -81,7 +81,7 @@ public void cancel() throws WrongStateException, SystemException { /** * The transaction has cancelled. The participant previously informed the coordinator that it had finished work but could * compensate later if required, and it is now requested to do so. - * + * * @throws WrongStateException never in this implementation. * @throws SystemException if unable to perform the compensating transaction. */ @@ -110,7 +110,7 @@ public void error() throws SystemException { /** * method called to perform commit or rollback of prepared changes to the underlying manager state after the participant * recovery record has been written - * + * * @param confirmed true if the log record has been written and changes should be rolled forward and false if it has not * been written and changes should be rolled back */ diff --git a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceBAImpl.java b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceBAImpl.java index b0b29da788..ae503fdfc7 100644 --- a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceBAImpl.java +++ b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceBAImpl.java @@ -30,7 +30,7 @@ /** * An adapter class that exposes a set as a transactional Web Service. - * + * * @author Paul Robinson (paul.robinson@redhat.com) */ @WebService(serviceName = "SetServiceBAService", portName = "SetServiceBA", name = "SetServiceBA", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/helloworld/wsba/participantcompletion/set") @@ -40,7 +40,7 @@ public class SetServiceBAImpl implements SetServiceBA { /** * Add an item to a set Enrolls a Participant if necessary and passes the call through to the business logic. - * + * * @param value the value to add to the set. * @throws AlreadyInSetException if value is already in the set * @throws SetServiceException if an error occurred when attempting to add the item to the set. @@ -110,7 +110,7 @@ public void addValueToSet(String value) throws AlreadyInSetException, SetService /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceException.java b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceException.java index 6640b743f7..17ecc10861 100644 --- a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceException.java +++ b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/SetServiceException.java @@ -18,11 +18,11 @@ /** * Exception used to communicate a general error in the SetService. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ public class SetServiceException extends Exception { - + /** Default value included to remove warning. **/ private static final long serialVersionUID = 1L; diff --git a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBA.java b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBA.java index 1367ec6bb1..71301633d8 100644 --- a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBA.java +++ b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBA.java @@ -24,9 +24,9 @@ /** * Interface implemented by SetServiceBA Web service and Client stub. - * + * * The Web service represents a simple set collection and this interface provides the basic methods for accessing it. - * + * * @author paul.robinson@redhat.com, 2011-12-21 */ @WebService(name = "SetServiceBA", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/helloworld/wsba/participantcompletion/set") @@ -34,7 +34,7 @@ public interface SetServiceBA { /** * Add a value to the set - * + * * @param value Value to add to the set. * @throws AlreadyInSetException if the item is already in the set. * @throws SetServiceException if an error occurred during the adding of the item to the set. @@ -44,7 +44,7 @@ public interface SetServiceBA { /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBAService.java b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBAService.java index 9734042b69..3b71b392f8 100644 --- a/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBAService.java +++ b/wsba-participant-completion-simple/src/main/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/jaxws/SetServiceBAService.java @@ -27,7 +27,7 @@ /** * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.2-hudson-182-RC1 Generated source version: 2.0 - * + * */ @WebServiceClient(name = "SetServiceBAService", targetNamespace = "http://www.jboss.org/jboss-jdf/jboss-as-quickstart/helloworld/wsba/participantcompletion/set") public class SetServiceBAService extends Service { @@ -58,7 +58,7 @@ public SetServiceBAService() { } /** - * + * * @return returns ISetServiceBA */ @WebEndpoint(name = "SetServiceBA") diff --git a/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/Client.java b/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/Client.java index 9c3cbbde66..56fb3cf343 100644 --- a/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/Client.java +++ b/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/Client.java @@ -32,7 +32,7 @@ /** * A Client stub to the SetService. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @ClientStub @@ -41,7 +41,7 @@ public class Client implements SetServiceBA { /** * Default constructor with hard-coded values for the SetService endpoint details (wsdl url, service name & port name) - * + * * @throws MalformedURLException if the WSDL url is malformed. */ public Client() throws MalformedURLException { @@ -66,7 +66,7 @@ public Client() throws MalformedURLException { /** * Add a value to the set - * + * * @param value Value to add to the set. * @throws AlreadyInSetException if the item is already in the set. * @throws SetServiceException if an error occurred during the adding of the item to the set. @@ -77,7 +77,7 @@ public void addValueToSet(String value) throws AlreadyInSetException, SetService /** * Query the set to see if it contains a particular value. - * + * * @param value the value to check for. * @return true if the value was present, false otherwise. */ diff --git a/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientStub.java b/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientStub.java index 4d3d8e954c..b5d161a724 100644 --- a/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientStub.java +++ b/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientStub.java @@ -29,10 +29,10 @@ /** * Qualifier for specifying which SetServiceBA implementation to use. - * + * * This Qualifier only supports the ClientStub implementation. The other class to implement SetServiceBA is the SetServiceBAImpl * class, which is not injected by CDI, so does not require Qualifier support. - * + * * @author paul.robinson@redhat.com, 2012-01-04 */ @Qualifier diff --git a/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientTest.java b/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientTest.java index 92a45dea82..edd521a29e 100644 --- a/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientTest.java +++ b/wsba-participant-completion-simple/src/test/java/org/jboss/as/quickstarts/wsba/participantcompletion/simple/ClientTest.java @@ -33,10 +33,10 @@ @RunWith(Arquillian.class) public class ClientTest { - + private static final String ManifestMF = "Manifest-Version: 1.0\n" + "Dependencies: org.jboss.xts\n"; - + @Inject @ClientStub public SetServiceBA client; @@ -52,7 +52,7 @@ public static WebArchive createTestArchive() { /** * Test the simple scenario where an item is added to the set within a Business Activity which is closed successfully. - * + * * @throws Exception if something goes wrong. */ @Test @@ -85,7 +85,7 @@ public void testSuccess() throws Exception { * Tests the scenario where an item is added to the set with in a business activity that is later cancelled. The test checks * that the item is in the set after invoking addValueToSet on the Web service. After cancelling the Business Activity, the * work should be compensated and thus the item should no longer be in the set. - * + * * @throws Exception if something goes wrong */ @Test @@ -120,7 +120,7 @@ public void testCancel() throws Exception { /** * Utility method for cancelling a Business Activity if it is currently active. - * + * * @param uba The User Business Activity to cancel. */ private void cancelIfActive(UserBusinessActivity uba) { diff --git a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Book.java b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Book.java index 66be1bc952..ecbe89a9f3 100644 --- a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Book.java +++ b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Book.java @@ -21,9 +21,9 @@ /** * Simple Java Bean which is used as a data structure. It stores information about book. - * + * * @author baranowb - * + * */ @SuppressWarnings("serial") public class Book implements Serializable { diff --git a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/DOM4JXMLParser.java b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/DOM4JXMLParser.java index 0c60cfb49f..32bb677835 100644 --- a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/DOM4JXMLParser.java +++ b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/DOM4JXMLParser.java @@ -38,9 +38,9 @@ /** * Implementation of parser based on DOM4J. - * + * * @author baranowb - * + * */ @RequestScoped @Default diff --git a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Error.java b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Error.java index 7efeb546ed..fd1bb7ee64 100644 --- a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Error.java +++ b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Error.java @@ -18,9 +18,9 @@ /** * Simple class which represents some sort of error. - * + * * @author baranowb - * + * */ public class Error { private Exception exception; diff --git a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Errors.java b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Errors.java index 3c867363fe..23b88d6884 100644 --- a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Errors.java +++ b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/Errors.java @@ -26,9 +26,9 @@ /** * Stores parsing errors - * + * * @author baranowb - * + * */ @SuppressWarnings("serial") @SessionScoped diff --git a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java index 2687cf0023..31f4cf3a38 100644 --- a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java +++ b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java @@ -33,9 +33,9 @@ /** * Simple class to provide base for XML file parsing. It will validate any document using the schema produced by * {@link Constants} - * + * * @author baranowb - * + * */ public abstract class XMLParser { @@ -71,7 +71,7 @@ public List parse(InputStream is) throws Exception { } /** - * + * * @param is * @return * @throws Exception diff --git a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java index d083cb01a3..bcc21d63db 100644 --- a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java +++ b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java @@ -31,9 +31,9 @@ /** * Backing bean to provide example with required logic to parse provided XML file.
      - * + * * @author baranowb - * + * */ /* * Annotated as: - SessionScope bean to tie its lifecycle to session. This is required to make it shared between UploadServlet @@ -43,7 +43,7 @@ public class FileUploadBean implements Serializable { /** - * + * */ private static final long serialVersionUID = -4542914921835861304L; diff --git a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java index ae48bf748f..3d62cfeed1 100644 --- a/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java +++ b/xml-dom4j/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java @@ -35,9 +35,9 @@ * Simple servlet to handle multipart file upload.
      * This servlet register itself as handler for '/upload' path in application. When request is made with said context, this * servlet is invoked to handle it. Once it is done, it redirects user agent to application root path. - * + * * @author baranowb - * + * */ // Mark this class as servlet and indicates that requests to // '/upload' URL in application be handled by this servlet. @@ -47,7 +47,7 @@ public class FileUploadServlet extends HttpServlet { /** - * + * */ private static final long serialVersionUID = 127759768859064589L; diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Book.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Book.java index 66be1bc952..ecbe89a9f3 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Book.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Book.java @@ -21,9 +21,9 @@ /** * Simple Java Bean which is used as a data structure. It stores information about book. - * + * * @author baranowb - * + * */ @SuppressWarnings("serial") public class Book implements Serializable { diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/DOMXMLParser.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/DOMXMLParser.java index 88c8beba80..5079c506a4 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/DOMXMLParser.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/DOMXMLParser.java @@ -39,9 +39,9 @@ /** * Implementation of parser based on JAXP DOM(W3C). - * + * * @author baranowb - * + * */ @RequestScoped @Default diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Error.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Error.java index 7efeb546ed..fd1bb7ee64 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Error.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Error.java @@ -18,9 +18,9 @@ /** * Simple class which represents some sort of error. - * + * * @author baranowb - * + * */ public class Error { private Exception exception; diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Errors.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Errors.java index 3c867363fe..23b88d6884 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Errors.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/Errors.java @@ -26,9 +26,9 @@ /** * Stores parsing errors - * + * * @author baranowb - * + * */ @SuppressWarnings("serial") @SessionScoped diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/SAXXMLParser.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/SAXXMLParser.java index c8456896ee..94f9cbb8ae 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/SAXXMLParser.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/SAXXMLParser.java @@ -36,9 +36,9 @@ /** * Implementation of parser based on JAXP DOM(W3C). - * + * * @author baranowb - * + * */ @RequestScoped @Alternative diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java index 2687cf0023..31f4cf3a38 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/XMLParser.java @@ -33,9 +33,9 @@ /** * Simple class to provide base for XML file parsing. It will validate any document using the schema produced by * {@link Constants} - * + * * @author baranowb - * + * */ public abstract class XMLParser { @@ -71,7 +71,7 @@ public List parse(InputStream is) throws Exception { } /** - * + * * @param is * @return * @throws Exception diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java index d083cb01a3..bcc21d63db 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadBean.java @@ -31,9 +31,9 @@ /** * Backing bean to provide example with required logic to parse provided XML file.
      - * + * * @author baranowb - * + * */ /* * Annotated as: - SessionScope bean to tie its lifecycle to session. This is required to make it shared between UploadServlet @@ -43,7 +43,7 @@ public class FileUploadBean implements Serializable { /** - * + * */ private static final long serialVersionUID = -4542914921835861304L; diff --git a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java index ae48bf748f..3d62cfeed1 100644 --- a/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java +++ b/xml-jaxp/src/main/java/org/jboss/as/quickstart/xml/upload/FileUploadServlet.java @@ -35,9 +35,9 @@ * Simple servlet to handle multipart file upload.
      * This servlet register itself as handler for '/upload' path in application. When request is made with said context, this * servlet is invoked to handle it. Once it is done, it redirects user agent to application root path. - * + * * @author baranowb - * + * */ // Mark this class as servlet and indicates that requests to // '/upload' URL in application be handled by this servlet. @@ -47,7 +47,7 @@ public class FileUploadServlet extends HttpServlet { /** - * + * */ private static final long serialVersionUID = 127759768859064589L;