├── jaxrs ├── jaxrs-client │ ├── src │ │ └── main │ │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── beans.xml │ └── pom.xml ├── jaxrs-security-declarative │ └── src │ │ └── test │ │ └── resources │ │ ├── password.txt │ │ └── addUsersPayara.txt ├── db-access │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── javaee7 │ │ │ └── jaxrs │ │ │ └── dbaccess │ │ │ └── MyApplication.java │ │ └── resources │ │ └── META-INF │ │ └── load.sql ├── beanparam │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jaxrs │ │ │ └── beanparam │ │ │ ├── MyApplication.java │ │ │ ├── MyPathParams.java │ │ │ └── MyQueryParams.java │ └── README.adoc ├── fileupload │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaxrs │ │ └── fileupload │ │ └── MyApplication.java ├── singleton │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jaxrs │ │ │ └── singleton │ │ │ └── MyAnnotatedApplication.java │ └── pom.xml ├── paramconverter │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jaxrs │ │ │ └── paramconverter │ │ │ ├── MyApplication.java │ │ │ └── MyBean.java │ └── README.adoc ├── simple-get │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jaxrs │ │ │ └── simple │ │ │ └── get │ │ │ ├── JaxRsActivator.java │ │ │ └── Resource.java │ └── pom.xml ├── link │ └── src │ │ └── main │ │ └── webapp │ │ └── index.jsp ├── readerwriter-injection │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaxrs │ │ └── readerwriter │ │ └── injection │ │ └── AnotherObject.java ├── client-negotiation │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaxrs │ │ └── client │ │ └── negotiation │ │ └── People.java ├── server-negotiation │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jaxrs │ │ │ └── server │ │ │ └── negotiation │ │ │ └── People.java │ └── pom.xml ├── jsonp │ └── pom.xml ├── readerwriter │ └── pom.xml └── jaxrs-endpoint │ └── pom.xml ├── json ├── object-reader │ └── src │ │ └── test │ │ └── resources │ │ ├── 1.json │ │ ├── 2.json │ │ ├── 3.json │ │ └── 4.json ├── streaming-parser │ └── src │ │ └── test │ │ └── resources │ │ ├── 1.json │ │ ├── 2.json │ │ ├── 3.json │ │ └── 4.json ├── README.md └── object-builder │ └── pom.xml ├── jaspic ├── invoke-ejb-cdi │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── beans.xml │ │ │ ├── jboss-web.xml │ │ │ ├── ibm-application-bnd.xml │ │ │ └── glassfish-web.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── invoke │ │ ├── bean │ │ ├── EJBBean.java │ │ └── CDIBean.java │ │ └── sam │ │ └── SamAutoRegistrationListener.java ├── dispatching-jsf-cdi │ └── src │ │ └── main │ │ ├── webapp │ │ ├── WEB-INF │ │ │ ├── beans.xml │ │ │ ├── jboss-web.xml │ │ │ ├── faces-config.xml │ │ │ ├── ibm-application-bnd.xml │ │ │ └── glassfish-web.xml │ │ ├── forward.xhtml │ │ ├── include.xhtml │ │ ├── forward-cdi.xhtml │ │ └── include-cdi.xhtml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── dispatching │ │ └── bean │ │ └── MyBean.java ├── dispatching │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ ├── ibm-application-bnd.xml │ │ │ └── glassfish-web.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── dispatching │ │ └── sam │ │ └── SamAutoRegistrationListener.java ├── custom-principal │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ ├── ibm-application-bnd.xml │ │ │ └── glassfish-web.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── customprincipal │ │ └── sam │ │ └── MyPrincipal.java ├── ejb-propagation │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ ├── jboss-web.xml │ │ ├── ibm-application-bnd.xml │ │ └── glassfish-web.xml ├── jacc-propagation │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ ├── jboss-web.xml │ │ ├── ibm-application-bnd.xml │ │ └── glassfish-web.xml ├── status-codes │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ ├── jboss-web.xml │ │ ├── ibm-application-bnd.xml │ │ └── glassfish-web.xml ├── async-authentication │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ ├── jboss-web.xml │ │ ├── ibm-application-bnd.xml │ │ └── glassfish-web.xml ├── basic-authentication │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ ├── jboss-web.xml │ │ ├── ibm-application-bnd.xml │ │ └── glassfish-web.xml ├── lifecycle │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ ├── ibm-application-bnd.xml │ │ │ └── glassfish-web.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── lifecycle │ │ └── sam │ │ └── SamAutoRegistrationListener.java ├── wrapping │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ ├── jboss-web.xml │ │ ├── ibm-application-bnd.xml │ │ └── glassfish-web.xml ├── programmatic-authentication │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ ├── jboss-web.xml │ │ ├── glassfish-web.xml │ │ └── ibm-application-bnd.xml ├── register-session │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ ├── ibm-application-bnd.xml │ │ │ └── glassfish-web.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── registersession │ │ └── sam │ │ └── MyPrincipal.java ├── ejb-register-session │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ ├── ibm-application-bnd.xml │ │ │ └── glassfish-web.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── registersession │ │ └── sam │ │ └── MyPrincipal.java ├── common │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaspic │ │ └── common │ │ └── BaseServletContextListener.java └── README.md ├── jpa ├── extended-pc │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ ├── drop.sql │ │ │ ├── create.sql │ │ │ └── load.sql │ └── pom.xml ├── criteria │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── load.sql ├── listeners │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── load.sql ├── multiple-pu │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── load.sql ├── native-sql │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── load.sql ├── pu-typesafe │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── .LCKcreate.sql~ │ │ ├── .LCKpersistence.xml~ │ │ ├── create.sql │ │ └── load.sql ├── jndi-context │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── load.sql ├── jpa-converter │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ ├── drop.sql │ │ │ │ ├── create.sql │ │ │ │ └── load.sql │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jpa │ │ │ └── converter │ │ │ ├── CreditCardConverter.java │ │ │ └── EmployeeRepository.java │ └── pom.xml ├── schema-gen-scripts │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── load.sql ├── storedprocedure │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── load.sql ├── unsynchronized-pc │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ ├── drop.sql │ │ │ ├── create.sql │ │ │ └── load.sql │ └── pom.xml ├── native-sql-resultset-mapping │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ └── create.sql ├── schema-gen-scripts-external │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ └── create.sql ├── listeners-injection │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── drop.sql │ │ │ └── create.sql │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jpa │ │ └── listeners │ │ ├── Language.java │ │ ├── MovieListener.java │ │ ├── MovieBean.java │ │ └── RatingService.java ├── entitygraph │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── drop.sql │ └── pom.xml ├── locking-pessimistic │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ └── beans.xml │ │ └── resources │ │ └── META-INF │ │ └── load.sql ├── datasourcedefinition │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jpa │ │ └── datasourcedefinition │ │ └── DataSourceDefinitionHolder.java ├── datasourcedefinition-annotation-pu │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jpa │ │ └── datasourcedefinition_annotation_pu │ │ └── config │ │ └── DataSourceDefinitionConfig.java ├── locking-optimistic │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── load.sql ├── ordercolumn │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── persistence.xml │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jpa │ │ │ └── ordercolumn │ │ │ └── entity │ │ │ └── unidirectional │ │ │ └── Child.java │ └── pom.xml ├── default-datasource │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── load.sql │ └── pom.xml ├── schema-gen-index │ └── pom.xml ├── schema-gen-metadata │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── load.sql │ └── pom.xml └── aggregate-function-in-select │ └── src │ └── main │ └── java │ └── org │ └── javaee7 │ └── jpa │ └── aggregate_function_in_select │ └── entity │ └── AggregatedTestEntity.java ├── jaxrpc ├── jaxrpc-endpoint │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ └── WEB-INF │ │ │ │ ├── .gitignore │ │ │ │ ├── wsdl │ │ │ │ ├── .gitignore │ │ │ │ └── README.md │ │ │ │ └── README.md │ │ │ ├── resources │ │ │ ├── META-INF │ │ │ │ └── services │ │ │ │ │ └── javax.xml.soap.MessageFactory │ │ │ ├── config.xml │ │ │ └── HelloService.xml │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jaxrpc │ │ │ └── endpoint │ │ │ ├── HelloServiceImpl.java │ │ │ └── HelloService.java │ └── build.xml └── jaxrpc-security │ └── src │ ├── main │ ├── webapp │ │ └── WEB-INF │ │ │ ├── .gitignore │ │ │ ├── wsdl │ │ │ ├── .gitignore │ │ │ └── README.md │ │ │ └── README.md │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaxrpc │ │ └── security │ │ ├── HelloServiceImpl.java │ │ └── HelloService.java │ └── test │ ├── resources │ ├── password.txt │ └── addUsersPayara.txt │ └── java │ └── stub │ ├── package-info.java │ └── .gitignore ├── jta ├── tx-exception │ └── src │ │ ├── main │ │ └── resources │ │ │ └── META-INF │ │ │ ├── drop.sql │ │ │ ├── create.sql │ │ │ └── load.sql │ │ └── test │ │ └── resources │ │ └── beans.xml ├── transactional │ └── src │ │ └── test │ │ └── resources │ │ └── beans.xml ├── user-transaction │ └── src │ │ └── test │ │ └── resources │ │ └── beans.xml └── README.md ├── ejb ├── remote │ ├── roles-allowed │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ ├── password.txt │ │ │ │ └── addUsersPayara.txt │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── ejb │ │ │ └── remote │ │ │ └── remote │ │ │ ├── BeanRemote.java │ │ │ └── Bean.java │ ├── roles-allowed-ssl │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ ├── password.txt │ │ │ │ └── addUsersPayara.txt │ │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── ejb │ │ │ │ └── remote │ │ │ │ └── ssl │ │ │ │ ├── BeanRemote.java │ │ │ │ └── Bean.java │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── application.xml │ └── vendor │ │ ├── payara-glassfish │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.javaee7.RemoteEJBContextProvider │ │ └── README.md │ │ └── README.md ├── timer │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ └── jboss-deployment-structure.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── ejb │ │ └── timer │ │ ├── Ping.java │ │ └── PingsListener.java ├── README.md ├── stateful │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── ejb │ │ └── stateful │ │ └── ReentrantStatefulBean.java └── async-ejb │ └── pom.xml ├── servlet ├── security-annotated │ └── src │ │ ├── test │ │ └── resources │ │ │ ├── password.txt │ │ │ └── addUsersPayara.txt │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml ├── security-basicauth │ └── src │ │ └── test │ │ └── resources │ │ ├── password.txt │ │ └── addUsersPayara.txt ├── security-clientcert │ └── .gitignore ├── security-form-based │ └── src │ │ └── test │ │ └── resources │ │ ├── password.txt │ │ └── addUsersPayara.txt ├── security-allow-uncovered │ └── src │ │ ├── test │ │ └── resources │ │ │ ├── password.txt │ │ │ └── addUsersPayara.txt │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── glassfish-web.xml ├── security-deny-uncovered │ └── src │ │ ├── test │ │ └── resources │ │ │ ├── password.txt │ │ │ └── addUsersPayara.txt │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── glassfish-web.xml ├── security-programmatic │ └── src │ │ ├── test │ │ └── resources │ │ │ ├── password.txt │ │ │ └── addUsersPayara.txt │ │ └── main │ │ └── webapp │ │ ├── WEB-INF │ │ ├── web.xml │ │ └── glassfish-web.xml │ │ └── index.jsp ├── security-basicauth-omission │ └── src │ │ └── test │ │ └── resources │ │ ├── password.txt │ │ └── addUsersPayara.txt ├── web-fragment │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── lib │ │ └── my-web-fragment.jar ├── resource-packaging │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── lib │ │ └── myResources.jar ├── simple-servlet │ ├── src │ │ └── main │ │ │ └── webapp │ │ │ └── index.jsp │ └── pom.xml ├── security-clientcert-jce │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── glassfish-web.xml ├── async-servlet │ └── pom.xml ├── error-mapping │ └── pom.xml └── programmatic-registration │ └── pom.xml ├── batch ├── chunk-csv-database │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── drop.sql │ │ ├── create.sql │ │ └── mydata.csv ├── scheduling │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── javaee7 │ │ │ │ │ └── batch │ │ │ │ │ └── samples │ │ │ │ │ └── scheduling │ │ │ │ │ ├── MyManagedScheduledBatch.java │ │ │ │ │ ├── MyTimerScheduleBean.java │ │ │ │ │ ├── MyBatchlet.java │ │ │ │ │ └── MyJob.java │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── batch-jobs │ │ │ │ └── myJob.xml │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── batch │ │ │ └── samples │ │ │ └── scheduling │ │ │ ├── MyJobAlternative.java │ │ │ ├── MyManagedScheduledBatchAlternative.java │ │ │ ├── MyTimerScheduleAlternative.java │ │ │ └── MyStepListener.java │ └── pom.xml ├── batch-listeners │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── batch │ │ └── batch │ │ └── listeners │ │ └── BatchListenerRecorder.java ├── chunk-exception │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── batch │ │ └── chunk │ │ └── exception │ │ ├── ChunkExceptionRecorder.java │ │ ├── MyRetryProcessorListener.java │ │ ├── MyRetryWriteListener.java │ │ └── MyRetryReadListener.java ├── flow │ └── pom.xml ├── split │ └── pom.xml ├── decision │ └── pom.xml └── README.md ├── jsf ├── contracts-library-impl │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── contracts │ │ ├── red │ │ └── javax.faces.contract.xml │ │ └── blue │ │ └── javax.faces.contract.xml ├── resource-handling │ └── src │ │ └── main │ │ └── webapp │ │ └── resources │ │ ├── scripts │ │ └── myScript.js │ │ ├── .DS_Store │ │ ├── wildfly.png │ │ └── corp │ │ └── sun-logo.png ├── components │ └── src │ │ └── main │ │ └── webapp │ │ ├── images │ │ └── glassfish.png │ │ ├── scripts │ │ └── main.js │ │ ├── resources │ │ └── stylesheets │ │ │ └── main.css │ │ ├── WEB-INF │ │ └── beans.xml │ │ └── next.xhtml ├── server-extension │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── javaee7 │ │ │ └── jsf │ │ │ └── server │ │ │ └── extension │ │ │ └── .t.swp │ │ └── webapp │ │ └── converter.xhtml ├── contracts-library │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── lib │ │ └── contracts-library-impl-1.0-SNAPSHOT.jar ├── contracts │ └── faces-config.NavData ├── ajax │ └── src │ │ └── main │ │ └── webapp │ │ ├── resources │ │ └── stylesheets │ │ │ └── main.css │ │ └── WEB-INF │ │ └── beans.xml ├── composite-component │ └── src │ │ └── main │ │ └── webapp │ │ └── resources │ │ └── stylesheets │ │ └── main.css └── http-get │ ├── src │ └── main │ │ └── webapp │ │ ├── WEB-INF │ │ └── beans.xml │ │ └── login.xhtml │ └── pom.xml ├── jms ├── jms-xa │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── META-INF │ │ │ │ │ └── load.sql │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── jms │ │ │ │ └── xa │ │ │ │ ├── User.java │ │ │ │ └── DeliveryStats.java │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jms │ │ │ └── xa │ │ │ └── producers │ │ │ ├── XAConnectionFactoryProducer.java │ │ │ └── NonXAConnectionFactoryProducer.java │ └── pom.xml ├── send-receive │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── beans.xml ├── README.md ├── jms-batch │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── batch-jobs │ │ │ └── jms-job.xml │ └── pom.xml └── temp-destination │ └── src │ └── main │ └── java │ └── org │ └── javaee7 │ └── jms │ └── temp │ └── destination │ └── Resources.java ├── websocket ├── atmosphere-chat │ └── overlays │ │ ├── org.atmosphere.client.javascript-2.0.7 │ │ └── WEB-INF │ │ │ └── web.xml │ │ └── org.atmosphere.client.javascript-2.0.7.info ├── websocket-vs-rest-payload │ ├── payloads.pcapng │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── javaee7 │ │ │ └── websocket │ │ │ └── websocket │ │ │ └── vs │ │ │ └── rest │ │ │ └── payload │ │ │ ├── ApplicationConfig.java │ │ │ ├── MyWebSocketEndpoint.java │ │ │ └── MyRestEndpoint.java │ │ └── webapp │ │ └── index.jsp ├── websocket-vs-rest │ └── src │ │ └── main │ │ └── webapp │ │ └── stylesheet.css ├── endpoint-programmatic-config │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── beans.xml ├── endpoint-wss │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── websocket │ │ │ └── endpoint │ │ │ └── wss │ │ │ └── MyEndpoint.java │ └── pom.xml ├── endpoint-async │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── websocket │ │ └── endpoint │ │ └── async │ │ ├── MyAsyncEndpointTextClient.java │ │ ├── MyAsyncEndpointByteBuffer.java │ │ └── MyAsyncEndpointByteBufferClient.java ├── binary │ └── pom.xml ├── chat │ └── pom.xml └── javase-client │ └── nbactions.xml ├── cdi ├── beansxml-noversion │ └── src │ │ ├── test │ │ └── resources │ │ │ └── beans.xml │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── cdi │ │ └── beansxml │ │ └── noversion │ │ ├── NotAnnotatedBean.java │ │ └── AnnotatedBean.java ├── extension-impl │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── javax.enterprise.inject.spi.Extension ├── dynamic-interceptor │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── META-INF │ │ │ │ │ └── services │ │ │ │ │ └── javax.enterprise.inject.spi.Extension │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── dynamic │ │ │ │ └── interceptor │ │ │ │ ├── MyBean.java │ │ │ │ └── extension │ │ │ │ ├── HelloInterceptorEnabler.java │ │ │ │ └── Hello.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── extension │ └── src │ │ └── main │ │ └── webapp │ │ └── WEB-INF │ │ └── lib │ │ └── extension-impl-1.0-SNAPSHOT.jar ├── events │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── events │ │ │ │ ├── EventReceiver.java │ │ │ │ ├── EventSender.java │ │ │ │ ├── GreetingSender.java │ │ │ │ └── GreetingReceiver.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── beanmanager │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── beanmanager │ │ │ │ ├── Greeting.java │ │ │ │ ├── SimpleGreeting.java │ │ │ │ └── SmileyGreeting.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── instance │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── instance │ │ │ │ ├── Greeting.java │ │ │ │ ├── SimpleGreeting.java │ │ │ │ └── FancyGreeting.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── events-conditional-reception │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── events │ │ │ │ └── conditional │ │ │ │ ├── EventReceiver.java │ │ │ │ ├── EventSender.java │ │ │ │ ├── GreetingSender.java │ │ │ │ └── GreetingReceiver.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── instance-qualifiers │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── instance │ │ │ │ ├── Greeting.java │ │ │ │ ├── FormalGreeting.java │ │ │ │ ├── SimpleGreeting.java │ │ │ │ ├── Business.java │ │ │ │ └── Personal.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── alternatives-priority │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── alternatives │ │ │ │ └── priority │ │ │ │ ├── Greeting.java │ │ │ │ ├── SimpleGreeting.java │ │ │ │ ├── FancyGreeting.java │ │ │ │ ├── ProducerMethodGreeting.java │ │ │ │ └── PriorityGreeting.java │ │ └── test │ │ │ └── resources │ │ │ ├── beans-empty.xml │ │ │ └── beans-alternatives.xml │ └── pom.xml ├── interceptors-priority │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── interceptors │ │ │ │ └── priority │ │ │ │ ├── Greeting.java │ │ │ │ ├── SimpleGreeting.java │ │ │ │ └── MyInterceptorBinding.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── bean-discovery-annotated │ └── src │ │ └── test │ │ └── resources │ │ └── beans.xml ├── bean-discovery-none │ └── src │ │ └── test │ │ └── resources │ │ └── beans.xml ├── nobeans-el-injection │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── cdi │ │ │ │ └── nobeans │ │ │ │ └── el │ │ │ │ └── injection │ │ │ │ └── ScopedBean.java │ │ │ └── webapp │ │ │ └── index.xhtml │ └── pom.xml ├── nobeans-el-injection-flowscoped │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── javaee7 │ │ │ └── cdi │ │ │ └── nobeans │ │ │ └── el │ │ │ └── injection │ │ │ └── flowscoped │ │ │ └── FlowScopedBean.java │ │ └── webapp │ │ └── myflow │ │ ├── myflow-flow.xml │ │ └── index.xhtml ├── interceptors │ ├── src │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml ├── vetoed │ └── pom.xml ├── decorators │ └── pom.xml ├── decorators-priority │ └── pom.xml ├── alternatives │ └── pom.xml └── decorators-builtin-beans │ └── pom.xml ├── Dockerfile ├── jacc ├── contexts │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ └── glassfish-web.xml │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jacc │ │ └── contexts │ │ └── sam │ │ └── SamAutoRegistrationListener.java └── README.md ├── jaxws ├── jaxws-client │ └── README.md ├── README.md ├── jaxws-endpoint-ejb │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── javaee7 │ │ └── jaxws │ │ └── endpoint │ │ └── ejb │ │ ├── EBookStore.java │ │ └── EBookStoreImpl.java └── jaxws-endpoint │ └── src │ └── main │ └── java │ └── org │ └── javaee7 │ └── jaxws │ └── endpoint │ └── EBookStore.java ├── interceptor ├── around-construct │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── javaee7 │ │ │ │ └── interceptor │ │ │ │ └── aroundconstruct │ │ │ │ ├── Param.java │ │ │ │ ├── Greeting.java │ │ │ │ ├── GreetingParam.java │ │ │ │ └── MyInterceptorBinding.java │ │ └── test │ │ │ └── resources │ │ │ └── beans.xml │ └── pom.xml └── README.md ├── jca ├── connector-simple │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── javaee7 │ │ │ └── jca │ │ │ └── connector │ │ │ └── simple │ │ │ └── connector │ │ │ └── outbound │ │ │ ├── MyInteraction.java │ │ │ ├── MyConnectionFactory.java │ │ │ └── MyManagedConnectionFactory.java │ └── pom.xml ├── mdb-filewatcher │ └── src │ │ └── test │ │ └── resources │ │ ├── glassfish-ejb-jar.xml │ │ └── jboss-ejb3.xml └── README.md ├── test-utils └── src │ └── main │ ├── java │ └── org │ │ └── javaee7 │ │ ├── RemoteEJBContextProvider.java │ │ ├── Parameter.java │ │ ├── Libraries.java │ │ └── RemoteEJBContextFactory.java │ └── resources │ └── tomcat-users.xml ├── concurrency ├── managedexecutor │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── javaee7 │ │ │ └── concurrency │ │ │ └── managedexecutor │ │ │ ├── TestStatus.java │ │ │ └── MyTransactionScopedBean.java │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml └── README.md ├── el └── README.md ├── javamail └── README.md └── validation ├── custom-constraint └── src │ └── main │ └── resources │ └── ValidationMessages.properties ├── methods └── src │ └── main │ └── java │ └── org │ └── javaee7 │ └── validation │ └── methods │ └── MyParameter.java └── README.md /jaxrs/jaxrs-client/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /json/object-reader/src/test/resources/1.json: -------------------------------------------------------------------------------- 1 | { } 2 | -------------------------------------------------------------------------------- /jaspic/invoke-ejb-cdi/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /json/streaming-parser/src/test/resources/1.json: -------------------------------------------------------------------------------- 1 | { } 2 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jpa/extended-pc/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE CHARACTERS -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/.gitignore: -------------------------------------------------------------------------------- 1 | /mapping.xml 2 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/main/webapp/WEB-INF/.gitignore: -------------------------------------------------------------------------------- 1 | /mapping.xml 2 | -------------------------------------------------------------------------------- /jpa/criteria/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE MOVIE_CRITERIA -------------------------------------------------------------------------------- /jpa/listeners/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE MOVIE_LISTENER -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /jpa/multiple-pu/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE MOVIE_MULTIPLE_PU -------------------------------------------------------------------------------- /jpa/native-sql/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_NATIVE_SQL -------------------------------------------------------------------------------- /jpa/pu-typesafe/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE MOVIE_PU_TYPESAFE -------------------------------------------------------------------------------- /jta/tx-exception/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_SCHEMA_JTA -------------------------------------------------------------------------------- /ejb/remote/roles-allowed/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/wsdl/.gitignore: -------------------------------------------------------------------------------- 1 | /MyHelloService.wsdl 2 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/main/webapp/WEB-INF/wsdl/.gitignore: -------------------------------------------------------------------------------- 1 | /MyHelloService.wsdl 2 | -------------------------------------------------------------------------------- /servlet/security-annotated/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /servlet/security-basicauth/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /servlet/security-clientcert/.gitignore: -------------------------------------------------------------------------------- 1 | /clientKeyStore.jks 2 | /clientTrustStore.jks 3 | -------------------------------------------------------------------------------- /servlet/security-form-based/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /batch/chunk-csv-database/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE CHUNK_CSV_DATABASE -------------------------------------------------------------------------------- /ejb/remote/roles-allowed-ssl/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /jaxrs/jaxrs-security-declarative/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /jpa/jndi-context/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_JNDI_CONTEXT 2 | -------------------------------------------------------------------------------- /jpa/jpa-converter/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_SCHEMA_CONVERTER -------------------------------------------------------------------------------- /jsf/contracts-library-impl/src/main/resources/META-INF/contracts/red/javax.faces.contract.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /servlet/security-allow-uncovered/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /servlet/security-deny-uncovered/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /servlet/security-programmatic/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /jpa/schema-gen-scripts/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_SCHEMA_GEN_SCRIPTS -------------------------------------------------------------------------------- /jpa/storedprocedure/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE MOVIE_STORED_PROCEDURE 2 | -------------------------------------------------------------------------------- /jsf/contracts-library-impl/src/main/resources/META-INF/contracts/blue/javax.faces.contract.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /json/object-reader/src/test/resources/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "apple":"red", 3 | "banana":"yellow" 4 | } -------------------------------------------------------------------------------- /servlet/security-basicauth-omission/src/test/resources/password.txt: -------------------------------------------------------------------------------- 1 | AS_ADMIN_USERPASSWORD=p1 2 | -------------------------------------------------------------------------------- /jpa/unsynchronized-pc/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC -------------------------------------------------------------------------------- /json/streaming-parser/src/test/resources/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "apple":"red", 3 | "banana":"yellow" 4 | } -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/README.md: -------------------------------------------------------------------------------- 1 | Generated file `mapping.xml` will be saved here. -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/main/webapp/WEB-INF/README.md: -------------------------------------------------------------------------------- 1 | Generated file `mapping.xml` will be saved here. -------------------------------------------------------------------------------- /jms/jms-xa/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO T_USERS("EMAIL") VALUES ('jack@itcrowd.pl') 2 | -------------------------------------------------------------------------------- /json/object-reader/src/test/resources/3.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "apple":"red" }, 3 | { "banana":"yellow" } 4 | ] -------------------------------------------------------------------------------- /json/streaming-parser/src/test/resources/3.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "apple":"red" }, 3 | { "banana":"yellow" } 4 | ] -------------------------------------------------------------------------------- /websocket/atmosphere-chat/overlays/org.atmosphere.client.javascript-2.0.7/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | DUMMY web.xml 2 | -------------------------------------------------------------------------------- /cdi/beansxml-noversion/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/wsdl/README.md: -------------------------------------------------------------------------------- 1 | Generated file `MyHelloService.wsdl` will be saved here. -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/main/webapp/WEB-INF/wsdl/README.md: -------------------------------------------------------------------------------- 1 | Generated file `MyHelloService.wsdl` will be saved here. -------------------------------------------------------------------------------- /jpa/native-sql-resultset-mapping/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_NATIVE_SQL_RESULTSET_MAPPING -------------------------------------------------------------------------------- /jpa/schema-gen-scripts-external/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE EMPLOYEE_SCHEMA_GEN_SCRIPTS_EXTERNAL -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos/wildfly 2 | ADD jaxrs/jaxrs-client/target/jaxrs-client.war /opt/wildfly/standalone/deployments/ 3 | -------------------------------------------------------------------------------- /jpa/listeners-injection/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE MOVIE_LISTENER 2 | DROP TABLE MOVIE_RATINGS 3 | -------------------------------------------------------------------------------- /cdi/extension-impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.javaee7.cdi.extension.impl.MyExtension -------------------------------------------------------------------------------- /jsf/resource-handling/src/main/webapp/resources/scripts/myScript.js: -------------------------------------------------------------------------------- 1 | document.write("Hello, this is from JavaScript bundled in resources!"); -------------------------------------------------------------------------------- /websocket/atmosphere-chat/overlays/org.atmosphere.client.javascript-2.0.7.info: -------------------------------------------------------------------------------- 1 | 1412104997000 2 | (?:[^/]+/)*?[^/]*? 3 | META-INF(?:$|/.+) -------------------------------------------------------------------------------- /jpa/extended-pc/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE CHARACTERS ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) -------------------------------------------------------------------------------- /ejb/remote/vendor/payara-glassfish/src/main/resources/META-INF/services/org.javaee7.RemoteEJBContextProvider: -------------------------------------------------------------------------------- 1 | org.javaee7.PayaraEJBContextProvider -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/resources/META-INF/services/javax.xml.soap.MessageFactory: -------------------------------------------------------------------------------- 1 | com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl -------------------------------------------------------------------------------- /jpa/native-sql/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_NATIVE_SQL ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) -------------------------------------------------------------------------------- /jta/tx-exception/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_SCHEMA_JTA ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) -------------------------------------------------------------------------------- /cdi/dynamic-interceptor/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.javaee7.cdi.dynamic.interceptor.extension.CdiExtension -------------------------------------------------------------------------------- /ejb/remote/roles-allowed/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /jpa/jndi-context/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_JNDI_CONTEXT ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) 2 | -------------------------------------------------------------------------------- /servlet/security-annotated/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /servlet/security-basicauth/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /ejb/remote/roles-allowed-ssl/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /jacc/contexts/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jpa/schema-gen-scripts/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_SCHEMA_GEN_SCRIPTS ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) -------------------------------------------------------------------------------- /jsf/components/src/main/webapp/images/glassfish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/jsf/components/src/main/webapp/images/glassfish.png -------------------------------------------------------------------------------- /servlet/security-deny-uncovered/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /servlet/security-form-based/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /servlet/security-programmatic/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /websocket/websocket-vs-rest-payload/payloads.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/websocket/websocket-vs-rest-payload/payloads.pcapng -------------------------------------------------------------------------------- /jaspic/dispatching/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaxrs/jaxrs-security-declarative/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /jpa/pu-typesafe/src/main/resources/META-INF/.LCKcreate.sql~: -------------------------------------------------------------------------------- 1 | /Users/arungup/code/workspaces/arun/javaee7-samples/samples/jpa/multiple-pu/src/main/resources/META-INF/create.sql -------------------------------------------------------------------------------- /jpa/unsynchronized-pc/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) -------------------------------------------------------------------------------- /jsf/components/src/main/webapp/scripts/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | 6 | 7 | -------------------------------------------------------------------------------- /servlet/security-allow-uncovered/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /servlet/security-basicauth-omission/src/test/resources/addUsersPayara.txt: -------------------------------------------------------------------------------- 1 | create-file-user --groups g1 --passwordfile ${project.build.directory}/test-classes/password.txt u1 -------------------------------------------------------------------------------- /jaspic/custom-principal/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/ejb-propagation/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/invoke-ejb-cdi/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/jacc-propagation/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/status-codes/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jpa/criteria/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE MOVIE_CRITERIA("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "ACTORS" VARCHAR(200) not null) -------------------------------------------------------------------------------- /jpa/listeners/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE MOVIE_LISTENER("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "ACTORS" VARCHAR(200) not null) -------------------------------------------------------------------------------- /jaspic/async-authentication/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/basic-authentication/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/lifecycle/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | jaspitest 4 | 5 | -------------------------------------------------------------------------------- /jaspic/wrapping/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | jaspitest 4 | 5 | -------------------------------------------------------------------------------- /jpa/multiple-pu/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE MOVIE_MULTIPLE_PU("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "ACTORS" VARCHAR(200) not null) -------------------------------------------------------------------------------- /jpa/pu-typesafe/src/main/resources/META-INF/.LCKpersistence.xml~: -------------------------------------------------------------------------------- 1 | /Users/arungup/code/workspaces/arun/javaee7-samples/samples/jpa/multiple-pu/src/main/resources/META-INF/persistence.xml -------------------------------------------------------------------------------- /jpa/pu-typesafe/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE MOVIE_PU_TYPESAFE("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "ACTORS" VARCHAR(200) not null) -------------------------------------------------------------------------------- /jsf/resource-handling/src/main/webapp/resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/jsf/resource-handling/src/main/webapp/resources/.DS_Store -------------------------------------------------------------------------------- /jpa/jpa-converter/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_SCHEMA_CONVERTER ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "CARD" VARCHAR(15) not null) -------------------------------------------------------------------------------- /jpa/native-sql-resultset-mapping/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_NATIVE_SQL_RESULTSET_MAPPING ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) -------------------------------------------------------------------------------- /jpa/schema-gen-scripts-external/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE EMPLOYEE_SCHEMA_GEN_SCRIPTS_EXTERNAL ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null) -------------------------------------------------------------------------------- /jsf/resource-handling/src/main/webapp/resources/wildfly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/jsf/resource-handling/src/main/webapp/resources/wildfly.png -------------------------------------------------------------------------------- /batch/chunk-csv-database/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE CHUNK_CSV_DATABASE ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "HIREDATE" VARCHAR(50) not null) -------------------------------------------------------------------------------- /jaspic/programmatic-authentication/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jaspitest 5 | 6 | -------------------------------------------------------------------------------- /jaspic/register-session/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | jaspitest 4 | 5 | -------------------------------------------------------------------------------- /jaspic/ejb-register-session/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | jaspitest 4 | 5 | -------------------------------------------------------------------------------- /jpa/storedprocedure/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE MOVIE_STORED_PROCEDURE("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "ACTORS" VARCHAR(200) not null) 2 | -------------------------------------------------------------------------------- /jsf/resource-handling/src/main/webapp/resources/corp/sun-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/jsf/resource-handling/src/main/webapp/resources/corp/sun-logo.png -------------------------------------------------------------------------------- /jaxws/jaxws-client/README.md: -------------------------------------------------------------------------------- 1 | This JAX-WS sample generated Java service class from a .wsdl file, deploys the endpoint war generated by javaee7-samples/jaxws/jaxws-endpoint 2 | and then tests against that. -------------------------------------------------------------------------------- /json/object-reader/src/test/resources/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"The Matrix", 3 | "year":1999, 4 | "cast":[ 5 | "Keanu Reaves", 6 | "Laurence Fishburne", 7 | "Carrie-Anne Moss" 8 | ] 9 | } -------------------------------------------------------------------------------- /servlet/web-fragment/src/main/webapp/WEB-INF/lib/my-web-fragment.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/servlet/web-fragment/src/main/webapp/WEB-INF/lib/my-web-fragment.jar -------------------------------------------------------------------------------- /json/streaming-parser/src/test/resources/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"The Matrix", 3 | "year":1999, 4 | "cast":[ 5 | "Keanu Reaves", 6 | "Laurence Fishburne", 7 | "Carrie-Anne Moss" 8 | ] 9 | } -------------------------------------------------------------------------------- /servlet/resource-packaging/src/main/webapp/WEB-INF/lib/myResources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/servlet/resource-packaging/src/main/webapp/WEB-INF/lib/myResources.jar -------------------------------------------------------------------------------- /cdi/extension/src/main/webapp/WEB-INF/lib/extension-impl-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/cdi/extension/src/main/webapp/WEB-INF/lib/extension-impl-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /jsf/server-extension/src/main/java/org/javaee7/jsf/server/extension/.t.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/jsf/server-extension/src/main/java/org/javaee7/jsf/server/extension/.t.swp -------------------------------------------------------------------------------- /websocket/websocket-vs-rest/src/main/webapp/stylesheet.css: -------------------------------------------------------------------------------- 1 | progress { 2 | -webkit-appearance: progress-bar; 3 | background-color:red; 4 | color: red; 5 | 6 | height: 3em; 7 | width: 30em; 8 | } -------------------------------------------------------------------------------- /cdi/events/src/main/java/org/javaee7/cdi/events/EventReceiver.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public interface EventReceiver { 7 | String getGreet(); 8 | } 9 | -------------------------------------------------------------------------------- /cdi/events/src/main/java/org/javaee7/cdi/events/EventSender.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public interface EventSender { 7 | void send(String message); 8 | } 9 | -------------------------------------------------------------------------------- /jpa/listeners-injection/src/main/java/org/javaee7/jpa/listeners/Language.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.listeners; 2 | 3 | /** 4 | * @author Patrik Dudits 5 | */ 6 | public enum Language { 7 | ENGLISH, GERMAN; 8 | } 9 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/resources/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /cdi/beanmanager/src/main/java/org/javaee7/cdi/beanmanager/Greeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.beanmanager; 2 | 3 | /** 4 | * @author Arun Gupta 5 | */ 6 | public interface Greeting { 7 | public String greet(String name); 8 | } 9 | -------------------------------------------------------------------------------- /jsf/contracts-library/src/main/webapp/WEB-INF/lib/contracts-library-impl-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee-samples/javaee7-samples/HEAD/jsf/contracts-library/src/main/webapp/WEB-INF/lib/contracts-library-impl-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /cdi/instance/src/main/java/org/javaee7/cdi/instance/Greeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | /** 4 | * @author Arun Gupta 5 | * @author Radim Hanus 6 | */ 7 | public interface Greeting { 8 | String greet(String name); 9 | } 10 | -------------------------------------------------------------------------------- /interceptor/around-construct/src/main/java/org/javaee7/interceptor/aroundconstruct/Param.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.interceptor.aroundconstruct; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public interface Param { 7 | String getValue(); 8 | } 9 | -------------------------------------------------------------------------------- /cdi/events-conditional-reception/src/main/java/org/javaee7/cdi/events/conditional/EventReceiver.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events.conditional; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public interface EventReceiver { 7 | String getGreet(); 8 | } 9 | -------------------------------------------------------------------------------- /jpa/entitygraph/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE MOVIE_ACTOR_AWARDS_ENTITY_GRAPH 2 | DROP TABLE MOVIE_AWARDS_ENTITY_GRAPH 3 | DROP TABLE MOVIE_DIRECTORS_ENTITY_GRAPH 4 | DROP TABLE MOVIE_ACTORS_ENTITY_GRAPH 5 | DROP TABLE MOVIE_ENTITY_GRAPH 6 | -------------------------------------------------------------------------------- /jsf/contracts/faces-config.NavData: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/test/java/stub/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated Client Stubs will appear in this package after the Maven build is executed. 3 | * The test {@link org.javaee7.jaxrpc.security.HelloTest} depends on these stubs. 4 | */ 5 | package stub; -------------------------------------------------------------------------------- /batch/chunk-csv-database/src/main/resources/META-INF/mydata.csv: -------------------------------------------------------------------------------- 1 | Penny, 12/1/12 2 | Leonard Hofstadter, 12/6/08 3 | Howard Wolowitz, 8/27/7 4 | Bernadette Rostenkowski-Wolowitz, 8/14/13 5 | Sheldon Cooper, 3/18/9 6 | Amy Farah Fowler, 11/22/10 7 | Raj Koothrappali, 3/2/11 -------------------------------------------------------------------------------- /batch/scheduling/src/main/java/org/javaee7/batch/samples/scheduling/MyManagedScheduledBatch.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | /** 4 | * @author Roberto Cortez 5 | */ 6 | public interface MyManagedScheduledBatch { 7 | void runJob(); 8 | } 9 | -------------------------------------------------------------------------------- /cdi/events-conditional-reception/src/main/java/org/javaee7/cdi/events/conditional/EventSender.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events.conditional; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public interface EventSender { 7 | void send(String message); 8 | } 9 | -------------------------------------------------------------------------------- /cdi/instance-qualifiers/src/main/java/org/javaee7/cdi/instance/Greeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | /** 4 | * @author Arun Gupta 5 | * @author Radim Hanus 6 | */ 7 | public interface Greeting { 8 | String greet(String name); 9 | } 10 | -------------------------------------------------------------------------------- /jca/connector-simple/src/main/java/org/javaee7/jca/connector/simple/connector/outbound/MyInteraction.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jca.connector.simple.connector.outbound; 2 | 3 | /** 4 | * 5 | * @author arungup 6 | */ 7 | public class MyInteraction { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /jca/connector-simple/src/main/java/org/javaee7/jca/connector/simple/connector/outbound/MyConnectionFactory.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jca.connector.simple.connector.outbound; 2 | 3 | /** 4 | * 5 | * @author arungup 6 | */ 7 | public class MyConnectionFactory { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/java/org/javaee7/jaxrpc/endpoint/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrpc.endpoint; 2 | 3 | public class HelloServiceImpl implements HelloService { 4 | 5 | public String sayHello(String input) { 6 | return "Hello " + input; 7 | } 8 | } -------------------------------------------------------------------------------- /ejb/remote/roles-allowed-ssl/src/main/java/org/javaee7/ejb/remote/ssl/BeanRemote.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7.ejb.remote.ssl; 3 | 4 | import javax.ejb.Remote; 5 | 6 | @Remote 7 | public interface BeanRemote { 8 | String method(); 9 | } 10 | -------------------------------------------------------------------------------- /ejb/remote/roles-allowed/src/main/java/org/javaee7/ejb/remote/remote/BeanRemote.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7.ejb.remote.remote; 3 | 4 | import javax.ejb.Remote; 5 | 6 | @Remote 7 | public interface BeanRemote { 8 | String method(); 9 | } 10 | -------------------------------------------------------------------------------- /jca/connector-simple/src/main/java/org/javaee7/jca/connector/simple/connector/outbound/MyManagedConnectionFactory.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jca.connector.simple.connector.outbound; 2 | 3 | /** 4 | * 5 | * @author arungup 6 | */ 7 | public class MyManagedConnectionFactory { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cdi/alternatives-priority/src/main/java/org/javaee7/cdi/alternatives/priority/Greeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.alternatives.priority; 2 | 3 | /** 4 | * @author Arun Gupta 5 | * @author Radim Hanus 6 | */ 7 | public interface Greeting { 8 | public String greet(String name); 9 | } 10 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/java/org/javaee7/jaxrpc/endpoint/HelloService.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrpc.endpoint; 2 | 3 | import java.rmi.Remote; 4 | import java.rmi.RemoteException; 5 | 6 | public interface HelloService extends Remote { 7 | String sayHello(String s) throws RemoteException; 8 | } -------------------------------------------------------------------------------- /jsf/ajax/src/main/webapp/resources/stylesheets/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | Document : main 3 | Created on : May 25, 2013, 12:35:17 PM 4 | Author : arungup 5 | Description: 6 | Purpose of the stylesheet follows. 7 | */ 8 | 9 | root { 10 | display: block; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /jsf/components/src/main/webapp/resources/stylesheets/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | Document : main 3 | Created on : May 25, 2013, 12:35:17 PM 4 | Author : arungup 5 | Description: 6 | Purpose of the stylesheet follows. 7 | */ 8 | 9 | root { 10 | display: block; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /cdi/interceptors-priority/src/main/java/org/javaee7/cdi/interceptors/priority/Greeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.interceptors.priority; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public interface Greeting { 7 | public String getGreet(); 8 | 9 | public void setGreet(String name); 10 | } 11 | -------------------------------------------------------------------------------- /jaspic/invoke-ejb-cdi/src/main/java/org/javaee7/jaspic/invoke/bean/EJBBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.invoke.bean; 2 | 3 | import javax.ejb.Stateless; 4 | 5 | @Stateless 6 | public class EJBBean { 7 | 8 | public String getText() { 9 | return "Called from EJB"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /jsf/composite-component/src/main/webapp/resources/stylesheets/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | Document : main 3 | Created on : May 25, 2013, 12:35:17 PM 4 | Author : arungup 5 | Description: 6 | Purpose of the stylesheet follows. 7 | */ 8 | 9 | root { 10 | display: block; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /jaxrs/db-access/src/main/java/org/javaee7/jaxrs/dbaccess/MyApplication.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.dbaccess; 2 | 3 | import javax.ws.rs.core.Application; 4 | 5 | /** 6 | * @author Arun Gupta 7 | */ 8 | @javax.ws.rs.ApplicationPath("webresources") 9 | public class MyApplication extends Application { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /jpa/listeners-injection/src/main/resources/META-INF/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE MOVIE_LISTENER("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "ACTORS" VARCHAR(200) not null, "LANGUAGE" VARCHAR(12)) 2 | CREATE TABLE MOVIE_RATINGS("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null, "RATING" INTEGER not null) -------------------------------------------------------------------------------- /cdi/beansxml-noversion/src/main/java/org/javaee7/cdi/beansxml/noversion/NotAnnotatedBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.beansxml.noversion; 2 | 3 | /** 4 | * @author Alexis Hassler 5 | */ 6 | public class NotAnnotatedBean { 7 | public String sayHello(String name) { 8 | return "Hello " + name; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /interceptor/around-construct/src/main/java/org/javaee7/interceptor/aroundconstruct/Greeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.interceptor.aroundconstruct; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public interface Greeting { 7 | boolean isConstructed(); 8 | 9 | boolean isInitialized(); 10 | 11 | Param getParam(); 12 | } 13 | -------------------------------------------------------------------------------- /cdi/beanmanager/src/main/java/org/javaee7/cdi/beanmanager/SimpleGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.beanmanager; 2 | 3 | /** 4 | * @author Arun Gupta 5 | */ 6 | public class SimpleGreeting implements Greeting { 7 | 8 | @Override 9 | public String greet(String name) { 10 | return "Hello " + name; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test-utils/src/main/java/org/javaee7/RemoteEJBContextProvider.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7; 3 | 4 | import javax.naming.Context; 5 | 6 | public interface RemoteEJBContextProvider { 7 | Context getContextWithCredentialsSet(String username, String password); 8 | void releaseContext(); 9 | } 10 | -------------------------------------------------------------------------------- /batch/scheduling/src/main/java/org/javaee7/batch/samples/scheduling/MyTimerScheduleBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | import javax.ejb.Singleton; 4 | import javax.ejb.Startup; 5 | 6 | /** 7 | * @author arungupta 8 | */ 9 | @Startup 10 | @Singleton 11 | public class MyTimerScheduleBean extends AbstractTimerBatch { 12 | } 13 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/forward.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Forward 7 | 8 | 9 | response from JSF forward 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/include.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Include 7 | 8 | 9 | response from JSF include 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaxrs/beanparam/src/main/java/org/javaee7/jaxrs/beanparam/MyApplication.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.beanparam; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @ApplicationPath("webresources") 10 | public class MyApplication extends Application { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /jaxrs/fileupload/src/main/java/org/javaee7/jaxrs/fileupload/MyApplication.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.fileupload; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @ApplicationPath("webresources") 10 | public class MyApplication extends Application { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cdi/beanmanager/src/main/java/org/javaee7/cdi/beanmanager/SmileyGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.beanmanager; 2 | 3 | /** 4 | * @author Arun Gupta 5 | */ 6 | public class SmileyGreeting extends SimpleGreeting { 7 | 8 | @Override 9 | public String greet(String name) { 10 | return super.greet(name) + " :-)"; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cdi/instance-qualifiers/src/main/java/org/javaee7/cdi/instance/FormalGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | @Business 7 | public class FormalGreeting implements Greeting { 8 | @Override 9 | public String greet(String name) { 10 | return "Good morning " + name; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /batch/scheduling/src/test/java/org/javaee7/batch/samples/scheduling/MyJobAlternative.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | /** 4 | * @author Roberto Cortez 5 | */ 6 | public class MyJobAlternative extends MyJob { 7 | 8 | @Override 9 | protected void afterRun() { 10 | System.out.println("Job submitted"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /cdi/events/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cdi/instance-qualifiers/src/main/java/org/javaee7/cdi/instance/SimpleGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | /** 4 | * @author Arun Gupta 5 | * @author Radim Hanus 6 | */ 7 | public class SimpleGreeting implements Greeting { 8 | @Override 9 | public String greet(String name) { 10 | return "Hello " + name; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /jaxrs/singleton/src/main/java/org/javaee7/jaxrs/singleton/MyAnnotatedApplication.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.singleton; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @ApplicationPath("webresources") 10 | public class MyAnnotatedApplication extends Application { 11 | } 12 | -------------------------------------------------------------------------------- /jsf/ajax/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /cdi/beanmanager/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cdi/instance/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/WEB-INF/faces-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /jaxrs/paramconverter/src/main/java/org/javaee7/jaxrs/paramconverter/MyApplication.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.paramconverter; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @ApplicationPath("webresources") 10 | public class MyApplication extends Application { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /jms/send-receive/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /jsf/components/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /jsf/http-get/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /cdi/interceptors-priority/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cdi/bean-discovery-annotated/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /cdi/instance-qualifiers/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /jpa/locking-pessimistic/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /batch/batch-listeners/src/main/java/org/javaee7/batch/batch/listeners/BatchListenerRecorder.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.batch.listeners; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | 5 | /** 6 | * @author Roberto Cortez 7 | */ 8 | public class BatchListenerRecorder { 9 | public static CountDownLatch batchListenersCountDownLatch = new CountDownLatch(60); 10 | } 11 | -------------------------------------------------------------------------------- /cdi/alternatives-priority/src/test/resources/beans-empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/forward-cdi.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Forward with CDI 7 | 8 | 9 | response from JSF forward - #{myBean.text} 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/include-cdi.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Include with CDI 7 | 8 | 9 | response from JSF include - #{myBean.text} 10 | 11 | 12 | -------------------------------------------------------------------------------- /test-utils/src/main/java/org/javaee7/Parameter.java: -------------------------------------------------------------------------------- 1 | package org.javaee7; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target({ElementType.FIELD}) 10 | public @interface Parameter { 11 | } 12 | 13 | -------------------------------------------------------------------------------- /websocket/websocket-vs-rest-payload/src/main/java/org/javaee7/websocket/websocket/vs/rest/payload/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.websocket.websocket.vs.rest.payload; 2 | 3 | import javax.ws.rs.core.Application; 4 | 5 | /** 6 | * @author Arun Gupta 7 | */ 8 | @javax.ws.rs.ApplicationPath("webresources") 9 | public class ApplicationConfig extends Application { 10 | } 11 | -------------------------------------------------------------------------------- /cdi/events-conditional-reception/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /concurrency/managedexecutor/src/main/java/org/javaee7/concurrency/managedexecutor/TestStatus.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.concurrency.managedexecutor; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | 5 | /** 6 | * @author Arun Gupta 7 | */ 8 | public class TestStatus { 9 | public static CountDownLatch latch; 10 | public static boolean foundTransactionScopedBean; 11 | } 12 | -------------------------------------------------------------------------------- /jta/transactional/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /jta/tx-exception/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /websocket/endpoint-programmatic-config/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /cdi/beansxml-noversion/src/main/java/org/javaee7/cdi/beansxml/noversion/AnnotatedBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.beansxml.noversion; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | 5 | /** 6 | * @author Alexis Hassler 7 | */ 8 | @RequestScoped 9 | public class AnnotatedBean { 10 | public String sayHello(String name) { 11 | return "Hello " + name; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cdi/dynamic-interceptor/src/main/java/org/javaee7/cdi/dynamic/interceptor/MyBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.dynamic.interceptor; 2 | 3 | import org.javaee7.cdi.dynamic.interceptor.extension.Hello; 4 | 5 | /** 6 | * 7 | * @author Arjan Tijms 8 | * 9 | */ 10 | public class MyBean { 11 | 12 | @Hello 13 | public String getName() { 14 | return "John"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ejb/remote/vendor/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: EJB - Remote - Vendor # 2 | 3 | This module contains vendor specific implementations to obtain the JNDI context from where remote EJB beans can be requested 4 | from with a username/password credential. 5 | 6 | ## Implementations ## 7 | 8 | - payara-glassfish - An implementation that works for both Payara and GlassFish 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /jta/user-transaction/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /cdi/bean-discovery-none/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /cdi/dynamic-interceptor/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ejb/timer/src/main/webapp/WEB-INF/jboss-deployment-structure.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /el/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: EL 3.0 # 2 | 3 | The [JSR 341](https://jcp.org/en/jsr/detail?id=341) is an update to Expression Language 2.2, currently part of JSR 245, JavaServer Page (JSP) 2.2. 4 | 5 | ## Samples ## 6 | 7 | - standalone 8 | 9 | ## How to run 10 | 11 | More information on how to run can be found at: 12 | 13 | 14 | -------------------------------------------------------------------------------- /javamail/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: Javamail 1.5# 2 | 3 | The [JSR 919](https://jcp.org/en/jsr/detail?id=919) seeks to define a description of the new APIs that are being introduced in JavaMail. 4 | 5 | ## Samples ## 6 | 7 | - definition 8 | 9 | ## How to run 10 | 11 | More information on how to run can be found at: 12 | 13 | 14 | -------------------------------------------------------------------------------- /cdi/instance/src/main/java/org/javaee7/cdi/instance/SimpleGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | 5 | /** 6 | * @author Arun Gupta 7 | * @author Radim Hanus 8 | */ 9 | @RequestScoped 10 | public class SimpleGreeting implements Greeting { 11 | @Override 12 | public String greet(String name) { 13 | return "Hello " + name; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /jaxrs/beanparam/README.adoc: -------------------------------------------------------------------------------- 1 | = JAX-RS BeanParam 2 | 3 | This example demonstrate the use of a +@BeanParam+ annotation to group some of the request parameters in a user bean, in order to avoid having too many paramaters in the method signature. 4 | 5 | The user type annotated with +@BeanParam+ may contain fields or setter methods annotated with +@MatrixParam+, +@QueryParam+, +@PathParam+, +@CookieParam+ or +@HeaderParam+. -------------------------------------------------------------------------------- /jta/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: JTA 1.2# 2 | 3 | The [JSR 907](https://jcp.org/en/jsr/detail?id=907) specifies a revisions to the JTA specification. 4 | 5 | ## Samples ## 6 | 7 | - transactional 8 | - tx-exception 9 | - user-transaction 10 | 11 | ## How to run 12 | 13 | More information on how to run can be found at: 14 | 15 | 16 | -------------------------------------------------------------------------------- /jaxws/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: JAX-WS 2.2# 2 | 3 | The [JSR 224](https://jcp.org/en/jsr/detail?id=224) specification is the next generation web services API replacing JAX-RPC 1.0. 4 | 5 | ## Samples ## 6 | 7 | - jaxws-endpoint 8 | - jaxws-client 9 | 10 | ## How to run 11 | 12 | More information on how to run can be found at: 13 | 14 | 15 | -------------------------------------------------------------------------------- /cdi/nobeans-el-injection/src/main/java/org/javaee7/cdi/nobeans/el/injection/ScopedBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.nobeans.el.injection; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | import javax.inject.Named; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @Named 10 | @RequestScoped 11 | public class ScopedBean { 12 | public String sayHello() { 13 | return "Hello there!"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/src/main/resources/HelloService.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /cdi/instance/src/main/java/org/javaee7/cdi/instance/FancyGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | 5 | /** 6 | * @author Arun Gupta 7 | * @author Radim Hanus 8 | */ 9 | @RequestScoped 10 | public class FancyGreeting implements Greeting { 11 | @Override 12 | public String greet(String name) { 13 | return "Nice to meet you, hello" + name; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ejb/remote/vendor/payara-glassfish/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: EJB - Remote - Vendor - Payara and GlassFish # 2 | 3 | This modules contains a class that returns a JNDI context suitable for remote lookups against the default URL 4 | for a remote Payara or GlassFish server (localhost). It sets the provided credentials 5 | in a Payara/GlassFish specific way and puts the required client jar on the classpath. 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /validation/custom-constraint/src/main/resources/ValidationMessages.properties: -------------------------------------------------------------------------------- 1 | # To change this license header, choose License Headers in Project Properties. 2 | # To change this template file, choose Tools | Templates 3 | # and open the template in the editor. 4 | 5 | org.sample.zipcode.min_size=At least 5 characters must be specified 6 | org.sample.zipcode.cannot_be_null=Cannot be null 7 | org.sample.zipcode.invalid_zipcode=Invalid zipcode -------------------------------------------------------------------------------- /batch/chunk-exception/src/main/java/org/javaee7/batch/chunk/exception/ChunkExceptionRecorder.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.chunk.exception; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | 5 | /** 6 | * @author Roberto Cortez 7 | */ 8 | public class ChunkExceptionRecorder { 9 | public static CountDownLatch chunkExceptionsCountDownLatch = new CountDownLatch(3); 10 | public static int retryReadExecutions = 0; 11 | } 12 | -------------------------------------------------------------------------------- /validation/methods/src/main/java/org/javaee7/validation/methods/MyParameter.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.validation.methods; 2 | 3 | import javax.validation.constraints.NotNull; 4 | 5 | public class MyParameter { 6 | 7 | @NotNull 8 | public String value; 9 | 10 | public String getValue() { 11 | return value; 12 | } 13 | 14 | public void setValue(String value) { 15 | this.value = value; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jca/mdb-filewatcher/src/test/resources/glassfish-ejb-jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FileWatchingMDB 7 | 8 | test#fswatcher 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jms/jms-xa/src/test/java/org/javaee7/jms/xa/producers/XAConnectionFactoryProducer.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jms.xa.producers; 2 | 3 | import javax.annotation.Resource; 4 | import javax.enterprise.inject.Produces; 5 | import javax.jms.ConnectionFactory; 6 | 7 | public class XAConnectionFactoryProducer { 8 | 9 | @Produces 10 | @Resource(lookup = "java:app/jms/xaConnectionFactory") 11 | private ConnectionFactory connectionFactory; 12 | } 13 | -------------------------------------------------------------------------------- /websocket/endpoint-wss/src/main/java/org/javaee7/websocket/endpoint/wss/MyEndpoint.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.websocket.endpoint.wss; 2 | 3 | import javax.websocket.OnMessage; 4 | import javax.websocket.server.ServerEndpoint; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @ServerEndpoint("/websocket") 10 | public class MyEndpoint { 11 | 12 | @OnMessage 13 | public String echoText(String name) { 14 | return name; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /cdi/events/src/main/java/org/javaee7/cdi/events/GreetingSender.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events; 2 | 3 | import javax.enterprise.event.Event; 4 | import javax.inject.Inject; 5 | 6 | /** 7 | * @author Radim Hanus 8 | */ 9 | public class GreetingSender implements EventSender { 10 | @Inject 11 | private Event event; 12 | 13 | @Override 14 | public void send(String message) { 15 | event.fire(message); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cdi/alternatives-priority/src/main/java/org/javaee7/cdi/alternatives/priority/SimpleGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.alternatives.priority; 2 | 3 | import javax.enterprise.inject.Alternative; 4 | 5 | /** 6 | * @author Arun Gupta 7 | * @author Radim Hanus 8 | */ 9 | @Alternative 10 | public class SimpleGreeting implements Greeting { 11 | @Override 12 | public String greet(String name) { 13 | return "Hello " + name; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cdi/nobeans-el-injection-flowscoped/src/main/java/org/javaee7/cdi/nobeans/el/injection/flowscoped/FlowScopedBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.nobeans.el.injection.flowscoped; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | import javax.inject.Named; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @Named 10 | @RequestScoped 11 | public class FlowScopedBean { 12 | public String sayHello() { 13 | return "Hello there!"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /jms/jms-xa/src/test/java/org/javaee7/jms/xa/producers/NonXAConnectionFactoryProducer.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jms.xa.producers; 2 | 3 | import javax.annotation.Resource; 4 | import javax.enterprise.inject.Produces; 5 | import javax.jms.ConnectionFactory; 6 | 7 | public class NonXAConnectionFactoryProducer { 8 | 9 | @Produces 10 | @Resource(lookup = "java:app/jms/nonXAconnectionFactory") 11 | private ConnectionFactory connectionFactory; 12 | } 13 | -------------------------------------------------------------------------------- /interceptor/around-construct/src/main/java/org/javaee7/interceptor/aroundconstruct/GreetingParam.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.interceptor.aroundconstruct; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | public class GreetingParam implements Param { 7 | private String value; 8 | 9 | public GreetingParam() { 10 | value = "Greeting"; 11 | } 12 | 13 | @Override 14 | public String getValue() { 15 | return value; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/main/java/org/javaee7/jaxrpc/security/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | 3 | package org.javaee7.jaxrpc.security; 4 | 5 | /** 6 | * Implementation class for the JAX-RPC remote web service. 7 | * 8 | * @author Arjan Tijms 9 | * 10 | */ 11 | public class HelloServiceImpl implements HelloService { 12 | 13 | public String sayHello(String input) { 14 | return "Hello " + input; 15 | } 16 | } -------------------------------------------------------------------------------- /jpa/extended-pc/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO CHARACTERS("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO CHARACTERS("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO CHARACTERS("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO CHARACTERS("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO CHARACTERS("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO CHARACTERS("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO CHARACTERS("ID", "NAME") VALUES (7, 'Howard') -------------------------------------------------------------------------------- /jsf/components/src/main/webapp/next.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Facelet Title 7 | 8 | 9 | Hello from Facelets 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /interceptor/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: Interceptor 1.2 # 2 | 3 | The [JSR 318](https://jcp.org/en/jsr/detail?id=318) specifies Interceptors 1.2. Since this is a maintenance release on top of 1.1 the JSR number still remained the same as EJB 3.1 (JSR 318). 4 | 5 | ## Samples ## 6 | 7 | - around-construct 8 | 9 | ## How to run 10 | 11 | More information on how to run can be found at: 12 | 13 | 14 | -------------------------------------------------------------------------------- /servlet/security-programmatic/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | g1 8 | 9 | 10 | -------------------------------------------------------------------------------- /cdi/nobeans-el-injection-flowscoped/src/main/webapp/myflow/myflow-flow.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /servlet/security-allow-uncovered/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | g1 6 | g1 7 | 8 | 9 | -------------------------------------------------------------------------------- /servlet/security-deny-uncovered/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | g1 6 | g1 7 | 8 | 9 | -------------------------------------------------------------------------------- /cdi/interceptors-priority/src/main/java/org/javaee7/cdi/interceptors/priority/SimpleGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.interceptors.priority; 2 | 3 | /** 4 | * @author Radim Hanus 5 | */ 6 | @MyInterceptorBinding 7 | public class SimpleGreeting implements Greeting { 8 | private String greet; 9 | 10 | public String getGreet() { 11 | return greet; 12 | } 13 | 14 | public void setGreet(String greet) { 15 | this.greet = greet; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cdi/nobeans-el-injection/src/main/webapp/index.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Facelet Title 7 | 8 | 9 | #{scopedBean.sayHello()} 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /jaxrs/simple-get/src/main/java/org/javaee7/jaxrs/simple/get/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7.jaxrs.simple.get; 3 | 4 | import javax.ws.rs.ApplicationPath; 5 | import javax.ws.rs.core.Application; 6 | 7 | /** 8 | * This class activates JAX-RS and sets the base path to "/rest". 9 | * 10 | * @author Arjan Tijms 11 | * 12 | */ 13 | @ApplicationPath("/rest") 14 | public class JaxRsActivator extends Application { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /json/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: JSON-P 1.0# 2 | 3 | The [JSR 353](https://jcp.org/en/jsr/detail?id=353) specifies a Java API to process (for e.g. parse, generate, transform and query) JSON. 4 | 5 | ## Samples ## 6 | 7 | - object-builder 8 | - object-reader 9 | - streaming-generate 10 | - streaming-parser 11 | 12 | ## How to run 13 | 14 | More information on how to run can be found at: 15 | 16 | 17 | -------------------------------------------------------------------------------- /cdi/dynamic-interceptor/src/main/java/org/javaee7/cdi/dynamic/interceptor/extension/HelloInterceptorEnabler.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.dynamic.interceptor.extension; 2 | 3 | import javax.annotation.Priority; 4 | import javax.interceptor.Interceptor; 5 | 6 | /** 7 | * Class used to enable (activate) the dynamic interceptor and sets its priority 8 | * 9 | * @author Arjan Tijms 10 | * 11 | */ 12 | @Interceptor 13 | @Priority(200) 14 | public class HelloInterceptorEnabler { 15 | 16 | } -------------------------------------------------------------------------------- /jms/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: JMS 2.0# 2 | 3 | The [JSR 343](https://jcp.org/en/jsr/detail?id=343) is an update to the Java Message Service API, an existing API for accessing enterprise messaging systems from Java programs. 4 | 5 | ## Samples ## 6 | 7 | - jms-xa 8 | - send-receive 9 | - temp-destination 10 | - jms-batch 11 | 12 | ## How to run 13 | 14 | More information on how to run can be found at: 15 | 16 | 17 | -------------------------------------------------------------------------------- /cdi/interceptors/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | org.javaee7.cdi.interceptors.MyInterceptor 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /cdi/events-conditional-reception/src/main/java/org/javaee7/cdi/events/conditional/GreetingSender.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events.conditional; 2 | 3 | import javax.enterprise.event.Event; 4 | import javax.inject.Inject; 5 | 6 | /** 7 | * @author Radim Hanus 8 | */ 9 | public class GreetingSender implements EventSender { 10 | @Inject 11 | private Event event; 12 | 13 | @Override 14 | public void send(String message) { 15 | event.fire(message); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /concurrency/managedexecutor/src/main/java/org/javaee7/concurrency/managedexecutor/MyTransactionScopedBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.concurrency.managedexecutor; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author Arun Gupta 7 | */ 8 | @javax.transaction.TransactionScoped 9 | public class MyTransactionScopedBean implements Serializable { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | public boolean isInTx() { 14 | return true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jacc/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: JACC - Java Authorization Contract for Containers # 2 | 3 | The [JSR 115](https://jcp.org/en/jsr/detail?id=115) seeks to define a contract between containers and authorization service providers that will result in the implementation of providers for use by containers. 4 | 5 | ## Samples ## 6 | 7 | - contexts 8 | 9 | ## How to run 10 | 11 | More information on how to run can be found at: 12 | 13 | 14 | -------------------------------------------------------------------------------- /websocket/websocket-vs-rest-payload/src/main/java/org/javaee7/websocket/websocket/vs/rest/payload/MyWebSocketEndpoint.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.websocket.websocket.vs.rest.payload; 2 | 3 | import javax.websocket.OnMessage; 4 | import javax.websocket.server.ServerEndpoint; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @ServerEndpoint("/websocket") 10 | public class MyWebSocketEndpoint { 11 | 12 | @OnMessage 13 | public String echoText(String text) { 14 | return text; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jca/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: JCA 1.7# 2 | 3 | The [JSR 322](https://jcp.org/en/jsr/detail?id=322) defines a standard architecture for connecting to Enterprise Information Systems. This JSR will enhance the existing specification with features requested by experts and community. 4 | 5 | ## Samples ## 6 | 7 | - connector-simple 8 | - mdb-filewatcher 9 | 10 | ## How to run 11 | 12 | More information on how to run can be found at: 13 | 14 | 15 | -------------------------------------------------------------------------------- /jpa/criteria/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO MOVIE_CRITERIA("ID", "NAME", "ACTORS") VALUES (1, 'The Matrix', 'Keanu Reeves, Laurence Fishburne, Carrie-Ann Moss') 2 | INSERT INTO MOVIE_CRITERIA("ID", "NAME", "ACTORS") VALUES (2, 'The Lord of The Rings', 'Elijah Wood, Ian Mckellen, Viggo Mortensen') 3 | INSERT INTO MOVIE_CRITERIA("ID", "NAME", "ACTORS") VALUES (3, 'Inception', 'Leonardo DiCaprio') 4 | INSERT INTO MOVIE_CRITERIA("ID", "NAME", "ACTORS") VALUES (4, 'The Shining', 'Jack Nicholson, Shelley Duvall') -------------------------------------------------------------------------------- /jpa/datasourcedefinition/src/main/java/org/javaee7/jpa/datasourcedefinition/DataSourceDefinitionHolder.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.datasourcedefinition; 2 | 3 | import javax.annotation.sql.DataSourceDefinition; 4 | import javax.ejb.Stateless; 5 | 6 | /** 7 | * @author Alexis Hassler 8 | */ 9 | @DataSourceDefinition(name = "java:global/MyApp/MyDataSource", 10 | className = "org.h2.jdbcx.JdbcDataSource", 11 | url = "jdbc:h2:mem:test") 12 | @Stateless 13 | public class DataSourceDefinitionHolder { 14 | } 15 | -------------------------------------------------------------------------------- /jpa/listeners/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO MOVIE_LISTENER("ID", "NAME", "ACTORS") VALUES (1, 'The Matrix', 'Keanu Reeves, Laurence Fishburne, Carrie-Ann Moss') 2 | INSERT INTO MOVIE_LISTENER("ID", "NAME", "ACTORS") VALUES (2, 'The Lord of The Rings', 'Elijah Wood, Ian Mckellen, Viggo Mortensen') 3 | INSERT INTO MOVIE_LISTENER("ID", "NAME", "ACTORS") VALUES (3, 'Inception', 'Leonardo DiCaprio') 4 | INSERT INTO MOVIE_LISTENER("ID", "NAME", "ACTORS") VALUES (4, 'The Shining', 'Jack Nicholson, Shelley Duvall') -------------------------------------------------------------------------------- /interceptor/around-construct/src/test/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | org.javaee7.interceptor.aroundconstruct.MyInterceptor 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaxrs/link/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 2 | 4 | 5 | 6 | 7 | 8 | JAX-RS 2 Links 9 | 10 | 11 |

JAX-RS 2 Links

12 | Invoke the Client. 13 | 14 | 15 | -------------------------------------------------------------------------------- /servlet/security-annotated/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | BASIC 8 | file 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/dispatching/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/lifecycle/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/status-codes/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/wrapping/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaxrs/readerwriter-injection/src/main/java/org/javaee7/jaxrs/readerwriter/injection/AnotherObject.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.readerwriter.injection; 2 | 3 | import javax.enterprise.context.ApplicationScoped; 4 | 5 | /** 6 | * @author Arun Gupta 7 | */ 8 | @ApplicationScoped 9 | public class AnotherObject { 10 | private int value; 11 | 12 | public int getValue() { 13 | return value; 14 | } 15 | 16 | public void setValue(int value) { 17 | this.value = value; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jpa/datasourcedefinition-annotation-pu/src/main/java/org/javaee7/jpa/datasourcedefinition_annotation_pu/config/DataSourceDefinitionConfig.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.datasourcedefinition_annotation_pu.config; 2 | 3 | import javax.annotation.sql.DataSourceDefinition; 4 | import javax.ejb.Stateless; 5 | 6 | @DataSourceDefinition( 7 | name = "java:app/MyApp/MyDS", 8 | className = "org.h2.jdbcx.JdbcDataSource", 9 | url = "jdbc:h2:mem:test") 10 | @Stateless 11 | public class DataSourceDefinitionConfig { 12 | } 13 | -------------------------------------------------------------------------------- /jpa/listeners-injection/src/main/java/org/javaee7/jpa/listeners/MovieListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.listeners; 2 | 3 | import javax.ejb.EJB; 4 | import javax.persistence.PostLoad; 5 | 6 | /** 7 | * @author Kuba Marchwicki 8 | */ 9 | public class MovieListener { 10 | 11 | @EJB 12 | RatingService service; 13 | 14 | @PostLoad 15 | public void loadMovieRating(Movie movie) { 16 | Integer rating = service.movieRating(movie.getName()); 17 | movie.setRating(rating); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jsf/http-get/src/main/webapp/login.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | HTTP GET (Login) 7 | 8 | 9 |

HTTP GET (Login)

10 | 11 | Login page invoked using HTTP GET 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /validation/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: Bean Validation 1.1# 2 | 3 | The [JSR 303](https://jcp.org/en/jsr/detail?id=303) specifies a meta-data model and API for JavaBeanTM validation based on annotations, with overrides and extended meta-data through the use of XML validation descriptors. 4 | 5 | ## Samples ## 6 | 7 | - methods 8 | - custom-constraint 9 | 10 | ## How to run 11 | 12 | More information on how to run can be found at: 13 | 14 | 15 | -------------------------------------------------------------------------------- /cdi/alternatives-priority/src/test/resources/beans-alternatives.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | org.javaee7.cdi.alternatives.priority.SimpleGreeting 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ejb/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: EJB 3.2 # 2 | 3 | The [JSR 345](https://jcp.org/en/jsr/detail?id=345) is an architecture for the development and deployment of component-based business applications. 4 | 5 | ## Samples ## 6 | 7 | - embeddable 8 | - lifecycle 9 | - remote 10 | - singleton 11 | - stateful 12 | - stateless 13 | - timer 14 | - async-ejb 15 | 16 | 17 | ## How to run 18 | 19 | More information on how to run can be found at: 20 | 21 | 22 | -------------------------------------------------------------------------------- /jaspic/custom-principal/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/ejb-propagation/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/invoke-ejb-cdi/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/jacc-propagation/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/register-session/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/test/java/stub/.gitignore: -------------------------------------------------------------------------------- 1 | /HelloService.java 2 | /HelloService_Stub.java 3 | /HelloService_sayHello_RequestStruct.java 4 | /HelloService_sayHello_RequestStruct_SOAPBuilder.java 5 | /HelloService_sayHello_RequestStruct_SOAPSerializer.java 6 | /HelloService_sayHello_ResponseStruct.java 7 | /HelloService_sayHello_ResponseStruct_SOAPBuilder.java 8 | /HelloService_sayHello_ResponseStruct_SOAPSerializer.java 9 | /MyHelloService.java 10 | /MyHelloService_Impl.java 11 | /MyHelloService_SerializerRegistry.java 12 | -------------------------------------------------------------------------------- /jpa/multiple-pu/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO MOVIE_MULTIPLE_PU("ID", "NAME", "ACTORS") VALUES (1, 'The Matrix', 'Keanu Reeves, Laurence Fishburne, Carrie-Ann Moss') 2 | INSERT INTO MOVIE_MULTIPLE_PU("ID", "NAME", "ACTORS") VALUES (2, 'The Lord of The Rings', 'Elijah Wood, Ian Mckellen, Viggo Mortensen') 3 | INSERT INTO MOVIE_MULTIPLE_PU("ID", "NAME", "ACTORS") VALUES (3, 'Inception', 'Leonardo DiCaprio') 4 | INSERT INTO MOVIE_MULTIPLE_PU("ID", "NAME", "ACTORS") VALUES (4, 'The Shining', 'Jack Nicholson, Shelley Duvall') -------------------------------------------------------------------------------- /jpa/pu-typesafe/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO MOVIE_PU_TYPESAFE("ID", "NAME", "ACTORS") VALUES (1, 'The Matrix', 'Keanu Reeves, Laurence Fishburne, Carrie-Ann Moss') 2 | INSERT INTO MOVIE_PU_TYPESAFE("ID", "NAME", "ACTORS") VALUES (2, 'The Lord of The Rings', 'Elijah Wood, Ian Mckellen, Viggo Mortensen') 3 | INSERT INTO MOVIE_PU_TYPESAFE("ID", "NAME", "ACTORS") VALUES (3, 'Inception', 'Leonardo DiCaprio') 4 | INSERT INTO MOVIE_PU_TYPESAFE("ID", "NAME", "ACTORS") VALUES (4, 'The Shining', 'Jack Nicholson, Shelley Duvall') -------------------------------------------------------------------------------- /jta/tx-exception/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_SCHEMA_JTA("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO EMPLOYEE_SCHEMA_JTA("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO EMPLOYEE_SCHEMA_JTA("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO EMPLOYEE_SCHEMA_JTA("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO EMPLOYEE_SCHEMA_JTA("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO EMPLOYEE_SCHEMA_JTA("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO EMPLOYEE_SCHEMA_JTA("ID", "NAME") VALUES (7, 'Howard') -------------------------------------------------------------------------------- /servlet/security-programmatic/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | g1 6 | g1 7 | g1 8 | 9 | 10 | -------------------------------------------------------------------------------- /cdi/alternatives-priority/src/main/java/org/javaee7/cdi/alternatives/priority/FancyGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.alternatives.priority; 2 | 3 | import javax.annotation.Priority; 4 | import javax.enterprise.inject.Alternative; 5 | 6 | /** 7 | * @author Arun Gupta 8 | * @author Radim Hanus 9 | */ 10 | @Priority(1000) 11 | @Alternative 12 | public class FancyGreeting implements Greeting { 13 | @Override 14 | public String greet(String name) { 15 | return "Nice to meet you, hello" + name; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cdi/instance-qualifiers/src/main/java/org/javaee7/cdi/instance/Business.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | import javax.inject.Qualifier; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.*; 8 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 9 | 10 | /** 11 | * @author Radim Hanus 12 | */ 13 | @Qualifier 14 | @Retention(RUNTIME) 15 | @Target({TYPE, METHOD, FIELD, PARAMETER}) 16 | public @interface Business { 17 | } 18 | -------------------------------------------------------------------------------- /cdi/instance-qualifiers/src/main/java/org/javaee7/cdi/instance/Personal.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.instance; 2 | 3 | import javax.inject.Qualifier; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.*; 8 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 9 | 10 | /** 11 | * @author Radim Hanus 12 | */ 13 | @Qualifier 14 | @Retention(RUNTIME) 15 | @Target({TYPE, METHOD, FIELD, PARAMETER}) 16 | public @interface Personal { 17 | } 18 | -------------------------------------------------------------------------------- /jacc/contexts/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/async-authentication/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/basic-authentication/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/ejb-register-session/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jaspic/lifecycle/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/wrapping/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-endpoint/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /jpa/locking-pessimistic/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO MOVIE_PESSIMISTIC("ID", "NAME", "ACTORS") VALUES (1, 'The Matrix', 'Keanu Reeves, Laurence Fishburne, Carrie-Ann Moss') 2 | INSERT INTO MOVIE_PESSIMISTIC("ID", "NAME", "ACTORS") VALUES (2, 'The Lord of The Rings', 'Elijah Wood, Ian Mckellen, Viggo Mortensen') 3 | INSERT INTO MOVIE_PESSIMISTIC("ID", "NAME", "ACTORS") VALUES (3, 'Inception', 'Leonardo DiCaprio') 4 | INSERT INTO MOVIE_PESSIMISTIC("ID", "NAME", "ACTORS") VALUES (4, 'The Shining', 'Jack Nicholson, Shelley Duvall') -------------------------------------------------------------------------------- /jaspic/dispatching/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/invoke-ejb-cdi/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/status-codes/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jms/jms-batch/src/main/resources/META-INF/batch-jobs/jms-job.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /cdi/alternatives-priority/src/main/java/org/javaee7/cdi/alternatives/priority/ProducerMethodGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.alternatives.priority; 2 | 3 | import javax.annotation.Priority; 4 | import javax.enterprise.inject.Alternative; 5 | import javax.enterprise.inject.Produces; 6 | 7 | /** 8 | * @author Radim Hanus 9 | */ 10 | @Priority(3000) 11 | public class ProducerMethodGreeting { 12 | 13 | @Produces 14 | @Alternative 15 | public Greeting getGreeting() { 16 | return new SimpleGreeting(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cdi/nobeans-el-injection-flowscoped/src/main/webapp/myflow/index.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Flow Scoped Page 7 | 8 | 9 |

Flow Scoped Page

10 | #{flowScopedBean.sayHello()} 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /jaspic/custom-principal/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/ejb-propagation/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/jacc-propagation/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/register-session/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /batch/scheduling/src/main/resources/META-INF/batch-jobs/myJob.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/async-authentication/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/basic-authentication/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/custom-principal/src/main/java/org/javaee7/jaspic/customprincipal/sam/MyPrincipal.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.customprincipal.sam; 2 | 3 | import java.security.Principal; 4 | 5 | /** 6 | * 7 | * @author Arjan Tijms 8 | * 9 | */ 10 | public class MyPrincipal implements Principal { 11 | 12 | private final String name; 13 | 14 | public MyPrincipal(String name) { 15 | this.name = name; 16 | } 17 | 18 | @Override 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jaspic/ejb-register-session/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaspic/register-session/src/main/java/org/javaee7/jaspic/registersession/sam/MyPrincipal.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.registersession.sam; 2 | 3 | import java.security.Principal; 4 | 5 | /** 6 | * 7 | * @author Arjan Tijms 8 | * 9 | */ 10 | public class MyPrincipal implements Principal { 11 | 12 | private final String name; 13 | 14 | public MyPrincipal(String name) { 15 | this.name = name; 16 | } 17 | 18 | @Override 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jpa/storedprocedure/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO MOVIE_STORED_PROCEDURE("ID", "NAME", "ACTORS") VALUES (1, 'The Matrix', 'Keanu Reeves, Laurence Fishburne, Carrie-Ann Moss') 2 | INSERT INTO MOVIE_STORED_PROCEDURE("ID", "NAME", "ACTORS") VALUES (2, 'The Lord of The Rings', 'Elijah Wood, Ian Mckellen, Viggo Mortensen') 3 | INSERT INTO MOVIE_STORED_PROCEDURE("ID", "NAME", "ACTORS") VALUES (3, 'Inception', 'Leonardo DiCaprio') 4 | INSERT INTO MOVIE_STORED_PROCEDURE("ID", "NAME", "ACTORS") VALUES (4, 'The Shining', 'Jack Nicholson, Shelley Duvall') -------------------------------------------------------------------------------- /jaspic/ejb-register-session/src/main/java/org/javaee7/jaspic/registersession/sam/MyPrincipal.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.registersession.sam; 2 | 3 | import java.security.Principal; 4 | 5 | /** 6 | * 7 | * @author Arjan Tijms 8 | * 9 | */ 10 | public class MyPrincipal implements Principal { 11 | 12 | private final String name; 13 | 14 | public MyPrincipal(String name) { 15 | this.name = name; 16 | } 17 | 18 | @Override 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jaspic/programmatic-authentication/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | architect 7 | architect 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jaxrs/db-access/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (7, 'Howard') 8 | INSERT INTO REST_DB_ACCESS("ID", "NAME") VALUES (8, 'Priya') -------------------------------------------------------------------------------- /cdi/alternatives-priority/src/main/java/org/javaee7/cdi/alternatives/priority/PriorityGreeting.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.alternatives.priority; 2 | 3 | import javax.annotation.Priority; 4 | import javax.enterprise.inject.Alternative; 5 | 6 | /** 7 | * @author Radim Hanus 8 | */ 9 | @Priority(2000) 10 | @Alternative 11 | public class PriorityGreeting implements Greeting { 12 | @Override 13 | public String greet(String name) { 14 | return "Hey " + name + " I should be selected since I've got the highest priority !"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jsf/server-extension/src/main/webapp/converter.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Server-side Extension 7 | 8 | 9 |

Called after Converter

10 | Got age: 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /servlet/simple-servlet/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 2 | 4 | 5 | 6 | 7 | 8 | Simple Servlet 9 | 10 | 11 |

Simple Servlet

12 | Call the servlet. 13 | 14 | 15 | -------------------------------------------------------------------------------- /ejb/remote/roles-allowed-ssl/src/main/java/org/javaee7/ejb/remote/ssl/Bean.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7.ejb.remote.ssl; 3 | 4 | import java.io.Serializable; 5 | 6 | import javax.annotation.security.RolesAllowed; 7 | import javax.ejb.Stateless; 8 | 9 | @Stateless 10 | public class Bean implements BeanRemote, Serializable { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | @Override 15 | @RolesAllowed("g1") 16 | public String method() { 17 | return "method"; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /test-utils/src/main/java/org/javaee7/Libraries.java: -------------------------------------------------------------------------------- 1 | package org.javaee7; 2 | 3 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 4 | import org.jboss.shrinkwrap.resolver.api.maven.Maven; 5 | 6 | public class Libraries { 7 | 8 | public static JavaArchive[] awaitability() { 9 | return Maven.resolver() 10 | .loadPomFromFile("pom.xml") 11 | .resolve("org.assertj:assertj-core", "com.jayway.awaitility:awaitility") 12 | .withTransitivity() 13 | .as(JavaArchive.class); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ejb/remote/roles-allowed/src/main/java/org/javaee7/ejb/remote/remote/Bean.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7.ejb.remote.remote; 3 | 4 | import java.io.Serializable; 5 | 6 | import javax.annotation.security.RolesAllowed; 7 | import javax.ejb.Stateless; 8 | 9 | @Stateless 10 | public class Bean implements BeanRemote, Serializable { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | @Override 15 | @RolesAllowed("g1") 16 | public String method() { 17 | return "method"; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jaxrs/client-negotiation/src/main/java/org/javaee7/jaxrs/client/negotiation/People.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.client.negotiation; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.xml.bind.annotation.XmlElement; 7 | import javax.xml.bind.annotation.XmlRootElement; 8 | 9 | @XmlRootElement 10 | public class People extends ArrayList { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | @XmlElement(name = "person") 15 | public List getPeople() { 16 | return this; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jaxrs/server-negotiation/src/main/java/org/javaee7/jaxrs/server/negotiation/People.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.server.negotiation; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.xml.bind.annotation.XmlElement; 7 | import javax.xml.bind.annotation.XmlRootElement; 8 | 9 | @XmlRootElement 10 | public class People extends ArrayList { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | @XmlElement(name = "person") 15 | public List getPeople() { 16 | return this; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test-utils/src/main/resources/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /jaspic/programmatic-authentication/src/main/webapp/WEB-INF/ibm-application-bnd.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /batch/scheduling/src/main/java/org/javaee7/batch/samples/scheduling/MyBatchlet.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | import static javax.batch.runtime.BatchStatus.COMPLETED; 4 | 5 | import javax.batch.api.AbstractBatchlet; 6 | import javax.inject.Named; 7 | 8 | /** 9 | * @author Roberto Cortez 10 | */ 11 | @Named 12 | public class MyBatchlet extends AbstractBatchlet { 13 | 14 | @Override 15 | public String process() { 16 | System.out.println("Running inside a batchlet"); 17 | 18 | return COMPLETED.toString(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /cdi/instance/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | cdi 9 | org.javaee7 10 | 1.0-SNAPSHOT 11 | 12 | 13 | cdi-instance 14 | Java EE 7 Sample: cdi - instance 15 | 16 | -------------------------------------------------------------------------------- /jaxrs/paramconverter/README.adoc: -------------------------------------------------------------------------------- 1 | = JAX-RS ParamConverter and ParamConverterProvider 2 | 3 | This example demonstrate the use of a +ParamConverter+ / +ParamConverterProvider+ to set the request parameters in a user bean 4 | that has no constructor with a single +String+ argument, nor +fromValue(String)+ or +valueOf(String)+ methods. 5 | The +ParamConverter+ is registered by a +ParamConverterProvider+ annotated with +@Provider+. 6 | 7 | The +ParamConverter+ applies to JAX-RS Resource Method parameters annotated with +@MatrixParam+, +@QueryParam+, +@PathParam+, +@CookieParam+ and +@HeaderParam+. -------------------------------------------------------------------------------- /websocket/endpoint-async/src/main/java/org/javaee7/websocket/endpoint/async/MyAsyncEndpointTextClient.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.websocket.endpoint.async; 2 | 3 | import javax.websocket.*; 4 | 5 | /** 6 | * 7 | * @author Jacek Jackowiak 8 | */ 9 | @ClientEndpoint 10 | public class MyAsyncEndpointTextClient { 11 | 12 | private String receivedMessage; 13 | 14 | @OnMessage 15 | public void onMessage(String msg) { 16 | receivedMessage = msg; 17 | } 18 | 19 | public String getReceivedMessage() { 20 | return receivedMessage; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /batch/chunk-exception/src/main/java/org/javaee7/batch/chunk/exception/MyRetryProcessorListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.chunk.exception; 2 | 3 | import javax.batch.api.chunk.listener.RetryProcessListener; 4 | import javax.inject.Named; 5 | 6 | /** 7 | * @author Roberto Cortez 8 | */ 9 | @Named 10 | public class MyRetryProcessorListener implements RetryProcessListener { 11 | @Override 12 | public void onRetryProcessException(Object item, Exception ex) throws Exception { 13 | System.out.println("MyRetryProcessorListener.onRetryProcessException"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cdi/dynamic-interceptor/src/main/java/org/javaee7/cdi/dynamic/interceptor/extension/Hello.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.dynamic.interceptor.extension; 2 | 3 | import static java.lang.annotation.ElementType.METHOD; 4 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 5 | 6 | import java.lang.annotation.Inherited; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.Target; 9 | 10 | import javax.interceptor.InterceptorBinding; 11 | 12 | 13 | @Inherited 14 | @InterceptorBinding 15 | @Retention(RUNTIME) 16 | @Target(METHOD) 17 | public @interface Hello { 18 | } -------------------------------------------------------------------------------- /jpa/locking-optimistic/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO MOVIE_OPTIMISTIC("ID", "NAME", "ACTORS", "VERSION") VALUES (1, 'The Matrix', 'Keanu Reeves, Laurence Fishburne, Carrie-Ann Moss', 0) 2 | INSERT INTO MOVIE_OPTIMISTIC("ID", "NAME", "ACTORS", "VERSION") VALUES (2, 'The Lord of The Rings', 'Elijah Wood, Ian Mckellen, Viggo Mortensen', 0) 3 | INSERT INTO MOVIE_OPTIMISTIC("ID", "NAME", "ACTORS", "VERSION") VALUES (3, 'Inception', 'Leonardo DiCaprio', 0) 4 | INSERT INTO MOVIE_OPTIMISTIC("ID", "NAME", "ACTORS", "VERSION") VALUES (4, 'The Shining', 'Jack Nicholson, Shelley Duvall', 0) 5 | -------------------------------------------------------------------------------- /cdi/beanmanager/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | org.javaee7 9 | cdi 10 | 1.0-SNAPSHOT 11 | 12 | cdi-beanmanager 13 | Java EE 7 Sample: cdi - beanmanager 14 | 15 | 16 | -------------------------------------------------------------------------------- /jca/mdb-filewatcher/src/test/resources/jboss-ejb3.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | FileWatchingMDB 8 | test.ear#fswatcher.rar 9 | 10 | 11 | -------------------------------------------------------------------------------- /jpa/native-sql/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (7, 'Howard') 8 | INSERT INTO EMPLOYEE_NATIVE_SQL("ID", "NAME") VALUES (8, 'Priya') -------------------------------------------------------------------------------- /jaxws/jaxws-endpoint-ejb/src/main/java/org/javaee7/jaxws/endpoint/ejb/EBookStore.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7.jaxws.endpoint.ejb; 3 | 4 | import static javax.jws.soap.SOAPBinding.Style.RPC; 5 | 6 | import javax.jws.WebMethod; 7 | import javax.jws.WebService; 8 | import javax.jws.soap.SOAPBinding; 9 | 10 | /** 11 | * 12 | * @author Fermin Gallego 13 | * @author Arjan Tijms 14 | * 15 | */ 16 | @WebService 17 | @SOAPBinding(style = RPC) 18 | public interface EBookStore { 19 | 20 | @WebMethod 21 | String welcomeMessage(String name); 22 | } 23 | -------------------------------------------------------------------------------- /servlet/security-clientcert-jce/src/main/webapp/WEB-INF/glassfish-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | g1 10 | g1 11 | CN=u1 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /servlet/security-programmatic/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 2 | 4 | 5 | 6 | 7 | 8 | Servlet Form-Based Security - Success 9 | 10 | 11 |

Servlet Programmatic Security

12 | 13 | Call Servlet 14 | 15 | 16 | -------------------------------------------------------------------------------- /batch/chunk-exception/src/main/java/org/javaee7/batch/chunk/exception/MyRetryWriteListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.chunk.exception; 2 | 3 | import javax.batch.api.chunk.listener.RetryWriteListener; 4 | import javax.inject.Named; 5 | import java.util.List; 6 | 7 | /** 8 | * @author Roberto Cortez 9 | */ 10 | @Named 11 | public class MyRetryWriteListener implements RetryWriteListener { 12 | @Override 13 | public void onRetryWriteException(List items, Exception ex) throws Exception { 14 | System.out.println("MyRetryWriteListener.onRetryWriteException"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /batch/scheduling/src/test/java/org/javaee7/batch/samples/scheduling/MyManagedScheduledBatchAlternative.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | import javax.ejb.Local; 4 | import javax.ejb.Stateless; 5 | import javax.enterprise.inject.Alternative; 6 | 7 | /** 8 | * @author Roberto Cortez 9 | */ 10 | @Alternative 11 | @Stateless 12 | @Local(MyManagedScheduledBatch.class) 13 | public class MyManagedScheduledBatchAlternative extends MyManagedScheduledBatchBean { 14 | 15 | @Override 16 | protected MyJob createJob() { 17 | return new MyJobAlternative(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jms/temp-destination/src/main/java/org/javaee7/jms/temp/destination/Resources.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jms.temp.destination; 2 | 3 | import javax.jms.JMSDestinationDefinition; 4 | 5 | /** 6 | * Application scoped JMS resources for the samples. 7 | * 8 | * @author Patrik Dudits 9 | */ 10 | @JMSDestinationDefinition( 11 | name = Resources.REQUEST_QUEUE, 12 | interfaceName = "javax.jms.Queue", 13 | destinationName = "requestQueue", 14 | description = "Queue for service requests") 15 | public class Resources { 16 | public static final String REQUEST_QUEUE = "java:global/jms/requestQueue"; 17 | } 18 | -------------------------------------------------------------------------------- /concurrency/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: Concurrency Utilities # 2 | 3 | The [JSR 236](https://jcp.org/en/jsr/detail?id=236) provides a simple, standardized API for using concurrency from application components without compromising container integrity while still preserving the Java EE platform's fundamental benefits. 4 | 5 | ## Samples ## 6 | 7 | - dynamicproxy 8 | - managedexecutor 9 | - managedscheduledexecutor 10 | - managedthreadfactory 11 | 12 | ## How to run 13 | 14 | More information on how to run can be found at: 15 | 16 | 17 | -------------------------------------------------------------------------------- /jpa/ordercolumn/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jms/jms-xa/src/main/java/org/javaee7/jms/xa/User.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jms.xa; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | import javax.persistence.Table; 6 | 7 | @Entity 8 | @Table(name = "T_USERS") 9 | public class User { 10 | 11 | @Id 12 | private String email; 13 | 14 | public User() { 15 | } 16 | 17 | public User(String email) { 18 | this.email = email; 19 | } 20 | 21 | public String getEmail() { 22 | return email; 23 | } 24 | 25 | public void setEmail(String email) { 26 | this.email = email; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jpa/jndi-context/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (7, 'Howard') 8 | INSERT INTO EMPLOYEE_JNDI_CONTEXT("ID", "NAME") VALUES (8, 'Priya') 9 | -------------------------------------------------------------------------------- /websocket/endpoint-async/src/main/java/org/javaee7/websocket/endpoint/async/MyAsyncEndpointByteBuffer.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.websocket.endpoint.async; 2 | 3 | import java.nio.ByteBuffer; 4 | import javax.websocket.OnMessage; 5 | import javax.websocket.Session; 6 | import javax.websocket.server.ServerEndpoint; 7 | 8 | /** 9 | * @author Jacek Jackowiak 10 | */ 11 | @ServerEndpoint("/bytebuffer") 12 | public class MyAsyncEndpointByteBuffer { 13 | 14 | @OnMessage 15 | public void echoByteBuffer(ByteBuffer data, Session session) { 16 | session.getAsyncRemote().sendBinary(data); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /websocket/websocket-vs-rest-payload/src/main/java/org/javaee7/websocket/websocket/vs/rest/payload/MyRestEndpoint.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.websocket.websocket.vs.rest.payload; 2 | 3 | import javax.ws.rs.Consumes; 4 | import javax.ws.rs.POST; 5 | import javax.ws.rs.Path; 6 | import javax.ws.rs.Produces; 7 | 8 | /** 9 | * REST Web Service 10 | * 11 | * @author Arun Gupta 12 | */ 13 | @Path("rest") 14 | public class MyRestEndpoint { 15 | 16 | @POST 17 | @Consumes("text/plain") 18 | @Produces("text/plain") 19 | public String getXml(String payload) { 20 | return payload; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cdi/dynamic-interceptor/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | cdi 7 | 1.0-SNAPSHOT 8 | 9 | 10 | dynamic-interceptor 11 | Java EE 7 sample: cdi - dynamic interceptor 12 | 13 | -------------------------------------------------------------------------------- /cdi/events/src/main/java/org/javaee7/cdi/events/GreetingReceiver.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events; 2 | 3 | import javax.enterprise.context.SessionScoped; 4 | import javax.enterprise.event.Observes; 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author Radim Hanus 9 | */ 10 | @SessionScoped 11 | public class GreetingReceiver implements EventReceiver, Serializable { 12 | private String greet = "Willkommen"; 13 | 14 | void receive(@Observes String greet) { 15 | this.greet = greet; 16 | } 17 | 18 | @Override 19 | public String getGreet() { 20 | return greet; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cdi/vetoed/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 4.0.0 7 | 8 | 9 | org.javaee7 10 | cdi 11 | 1.0-SNAPSHOT 12 | 13 | 14 | cdi-vetoed 15 | Java EE 7 Sample: cdi - vetoed 16 | 17 | 18 | -------------------------------------------------------------------------------- /jaspic/common/src/main/java/org/javaee7/jaspic/common/BaseServletContextListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.common; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | import javax.servlet.ServletContextListener; 5 | 6 | /** 7 | * 8 | * @author Arjan Tijms 9 | * 10 | */ 11 | public class BaseServletContextListener implements ServletContextListener { 12 | 13 | @Override 14 | public void contextInitialized(ServletContextEvent arg0) { 15 | // NOOP 16 | } 17 | 18 | @Override 19 | public void contextDestroyed(ServletContextEvent arg0) { 20 | // NOOP 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jca/connector-simple/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | jca 6 | org.javaee7 7 | 1.0-SNAPSHOT 8 | 9 | 10 | jca-connector-simple-connector 11 | Java EE 7 Sample: jca - Connector simple 12 | 13 | 14 | -------------------------------------------------------------------------------- /jpa/unsynchronized-pc/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO EMPLOYEE_SCHEMA_UNSYNCHRONIZED_PC("ID", "NAME") VALUES (7, 'Howard') -------------------------------------------------------------------------------- /jpa/jpa-converter/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_SCHEMA_CONVERTER("ID", "NAME", "CARD") VALUES (1, 'Leonard', '11-22-33-44') 2 | INSERT INTO EMPLOYEE_SCHEMA_CONVERTER("ID", "NAME", "CARD") VALUES (2, 'Sheldon', '22-33-44-55') 3 | INSERT INTO EMPLOYEE_SCHEMA_CONVERTER("ID", "NAME", "CARD") VALUES (3, 'Penny', '33-44-55-66') 4 | INSERT INTO EMPLOYEE_SCHEMA_CONVERTER("ID", "NAME", "CARD") VALUES (4, 'Raj', '44-55-66-77') 5 | INSERT INTO EMPLOYEE_SCHEMA_CONVERTER("ID", "NAME", "CARD") VALUES (5, 'Howard', '55-66-77-88') 6 | INSERT INTO EMPLOYEE_SCHEMA_CONVERTER("ID", "NAME", "CARD") VALUES (6, 'Bernadette', '66-77-88-99') -------------------------------------------------------------------------------- /websocket/binary/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | org.javaee7.websocket 7 | websocket-samples 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | 12 | binary 13 | war 14 | 15 | -------------------------------------------------------------------------------- /cdi/decorators/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | cdi 7 | 1.0-SNAPSHOT 8 | 9 | 10 | cdi-decorators 11 | war 12 | Java EE 7 Sample: cdi - decorators 13 | 14 | -------------------------------------------------------------------------------- /jaxrs/jsonp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | jaxrs 7 | 1.0-SNAPSHOT 8 | 9 | 10 | jaxrs-jsonp 11 | war 12 | Java EE 7 Sample: jaxrs - jsonp 13 | 14 | 15 | -------------------------------------------------------------------------------- /jpa/listeners-injection/src/main/java/org/javaee7/jpa/listeners/MovieBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.listeners; 2 | 3 | import javax.ejb.Stateless; 4 | import javax.persistence.EntityManager; 5 | import javax.persistence.PersistenceContext; 6 | 7 | /** 8 | * @author Kuba Marchwicki 9 | */ 10 | @Stateless 11 | public class MovieBean { 12 | @PersistenceContext 13 | private EntityManager em; 14 | 15 | public Movie getMovieByName(String name) { 16 | return em.createNamedQuery(Movie.FIND_BY_NAME, Movie.class) 17 | .setParameter("name", name) 18 | .getSingleResult(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /servlet/async-servlet/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | servlet 8 | 1.0-SNAPSHOT 9 | 10 | 11 | servlet-async-servlet 12 | war 13 | 14 | Java EE 7 Sample: servlet - async-servlet 15 | 16 | -------------------------------------------------------------------------------- /ejb/stateful/src/main/java/org/javaee7/ejb/stateful/ReentrantStatefulBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.ejb.stateful; 2 | 3 | import javax.annotation.Resource; 4 | import javax.ejb.SessionContext; 5 | import javax.ejb.Stateful; 6 | 7 | /** 8 | * 9 | * @author Arjan Tijms 10 | * 11 | */ 12 | @Stateful 13 | public class ReentrantStatefulBean { 14 | 15 | @Resource 16 | private SessionContext sessionConext; 17 | 18 | public void initialMethod() { 19 | sessionConext.getBusinessObject(ReentrantStatefulBean.class).reentrantMehthod(); 20 | } 21 | 22 | public void reentrantMehthod() { 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /cdi/events/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | cdi 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | cdi-events 12 | Java EE 7 Sample: cdi - events 13 | 14 | -------------------------------------------------------------------------------- /jaxrpc/jaxrpc-security/src/main/java/org/javaee7/jaxrpc/security/HelloService.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | 3 | package org.javaee7.jaxrpc.security; 4 | 5 | import java.rmi.Remote; 6 | import java.rmi.RemoteException; 7 | 8 | /** 9 | * The mandated interface for a JAX-RPC remote web service. 10 | * 11 | *

12 | * Note the mandated extension from the {@link Remote} interface 13 | * and the service method having to throw a {@link RemoteException}. 14 | * 15 | * @author Arjan Tijms 16 | * 17 | */ 18 | public interface HelloService extends Remote { 19 | String sayHello(String input) throws RemoteException; 20 | } -------------------------------------------------------------------------------- /jaxrs/simple-get/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | jaxrs 7 | 1.0-SNAPSHOT 8 | 9 | 10 | simple-get 11 | war 12 | 13 | Java EE 7 Sample: jaxrs - simple-get 14 | 15 | 16 | -------------------------------------------------------------------------------- /jpa/default-datasource/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Penny') 2 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Sheldon') 3 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Amy') 4 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Leonard') 5 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Bernadette') 6 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Raj') 7 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Howard') 8 | INSERT INTO EMPLOYEE_SCHEMA_DEFAULT_DATASOURCE("NAME") VALUES ('Priya') -------------------------------------------------------------------------------- /batch/scheduling/src/test/java/org/javaee7/batch/samples/scheduling/MyTimerScheduleAlternative.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | import javax.ejb.Schedule; 4 | import javax.ejb.Singleton; 5 | import javax.ejb.Startup; 6 | 7 | /** 8 | * @author Roberto Cortez 9 | */ 10 | @Startup 11 | @Singleton 12 | public class MyTimerScheduleAlternative extends AbstractTimerBatch { 13 | 14 | @Override 15 | @Schedule(hour = "*", minute = "*", second = "*/10", persistent = false) 16 | public void myJob() { 17 | super.myJob(); 18 | } 19 | 20 | @Override 21 | protected void afterRun() { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jaspic/dispatching-jsf-cdi/src/main/java/org/javaee7/jaspic/dispatching/bean/MyBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.dispatching.bean; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | import javax.inject.Inject; 5 | import javax.inject.Named; 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | @Named 9 | @RequestScoped 10 | public class MyBean { 11 | 12 | @Inject 13 | private HttpServletRequest request; 14 | 15 | public String getText() { 16 | return "Called from CDI\n"; 17 | } 18 | 19 | public String getServletPath() { 20 | return request.getServletPath(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jaxrs/paramconverter/src/main/java/org/javaee7/jaxrs/paramconverter/MyBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.paramconverter; 2 | 3 | /** 4 | * @author Xavier Coulon 5 | * 6 | */ 7 | public class MyBean { 8 | 9 | private String value; 10 | 11 | /** 12 | * @return the value 13 | */ 14 | public String getValue() { 15 | return value; 16 | } 17 | 18 | /** 19 | * @param value the value to set 20 | */ 21 | public void setValue(String value) { 22 | this.value = value; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return getValue(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /jpa/jpa-converter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jpa 8 | 1.0-SNAPSHOT 9 | 10 | 11 | jpa-jpa-converter 12 | jar 13 | 14 | Java EE 7 Sample: jpa-converter 15 | 16 | -------------------------------------------------------------------------------- /batch/scheduling/src/main/java/org/javaee7/batch/samples/scheduling/MyJob.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | import javax.batch.runtime.BatchRuntime; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Properties; 7 | 8 | /** 9 | * @author arungupta 10 | */ 11 | public class MyJob implements Runnable { 12 | 13 | public static List executedBatchs = new ArrayList<>(); 14 | 15 | public void run() { 16 | executedBatchs.add(BatchRuntime.getJobOperator().start("myJob", new Properties())); 17 | afterRun(); 18 | } 19 | 20 | protected void afterRun() { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cdi/decorators-priority/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | cdi 7 | 1.0-SNAPSHOT 8 | 9 | 10 | cdi-decorators-priority 11 | war 12 | Java EE 7 Sample: cdi - decorators priority 13 | 14 | -------------------------------------------------------------------------------- /cdi/instance-qualifiers/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | cdi 9 | org.javaee7 10 | 1.0-SNAPSHOT 11 | ../pom.xml 12 | 13 | 14 | cdi-instance-qualifiers 15 | Java EE 7 Sample: cdi - instance-qualifiers 16 | 17 | -------------------------------------------------------------------------------- /ejb/timer/src/main/java/org/javaee7/ejb/timer/Ping.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.ejb.timer; 2 | 3 | public class Ping { 4 | 5 | private String timeInfo; 6 | private long time = System.currentTimeMillis(); 7 | 8 | public Ping(String s) { 9 | this.timeInfo = s; 10 | } 11 | 12 | public long getTime() { 13 | return time; 14 | } 15 | 16 | public String getTimeInfo() { 17 | return timeInfo; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return "Ping {" + 23 | "timeInfo='" + timeInfo + '\'' + 24 | ", time=" + time + 25 | '}'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ejb/timer/src/main/java/org/javaee7/ejb/timer/PingsListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.ejb.timer; 2 | 3 | import javax.ejb.Singleton; 4 | import javax.ejb.Startup; 5 | import javax.enterprise.event.Observes; 6 | import java.util.List; 7 | import java.util.concurrent.CopyOnWriteArrayList; 8 | 9 | @Startup 10 | @Singleton 11 | public class PingsListener { 12 | 13 | final List pings = new CopyOnWriteArrayList<>(); 14 | 15 | public void listen(@Observes Ping ping) { 16 | System.out.println("ping = " + ping); 17 | pings.add(ping); 18 | } 19 | 20 | public List getPings() { 21 | return pings; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /interceptor/around-construct/src/main/java/org/javaee7/interceptor/aroundconstruct/MyInterceptorBinding.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.interceptor.aroundconstruct; 2 | 3 | import javax.interceptor.InterceptorBinding; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.METHOD; 8 | import static java.lang.annotation.ElementType.TYPE; 9 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 10 | 11 | /** 12 | * @author Radim Hanus 13 | */ 14 | @InterceptorBinding 15 | @Retention(RUNTIME) 16 | @Target({ METHOD, TYPE }) 17 | public @interface MyInterceptorBinding { 18 | } 19 | -------------------------------------------------------------------------------- /jaxrs/simple-get/src/main/java/org/javaee7/jaxrs/simple/get/Resource.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | 3 | package org.javaee7.jaxrs.simple.get; 4 | 5 | import static javax.ws.rs.core.MediaType.TEXT_PLAIN; 6 | 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.Path; 9 | import javax.ws.rs.Produces; 10 | 11 | /** 12 | * A very simple JAX-RS resource class that just returns the string "hi!" 13 | * 14 | * @author Arjan Tijms 15 | * 16 | */ 17 | @Path("/resource") 18 | @Produces(TEXT_PLAIN) 19 | public class Resource { 20 | 21 | @GET 22 | @Path("hi") 23 | public String hi() { 24 | return "hi!"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /jaxws/jaxws-endpoint-ejb/src/main/java/org/javaee7/jaxws/endpoint/ejb/EBookStoreImpl.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7.jaxws.endpoint.ejb; 3 | 4 | import javax.ejb.Stateless; 5 | import javax.jws.WebService; 6 | 7 | /** 8 | * 9 | * @author Fermin Gallego 10 | * @author Arjan Tijms 11 | * 12 | */ 13 | @Stateless 14 | @WebService(endpointInterface = "org.javaee7.jaxws.endpoint.ejb.EBookStore") 15 | public class EBookStoreImpl implements EBookStore { 16 | 17 | @Override 18 | public String welcomeMessage(String name) { 19 | return "Welcome to EBookStore WebService, Mr/Mrs " + name; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jpa/schema-gen-index/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | jpa 7 | 1.0-SNAPSHOT 8 | 9 | 10 | jpa-schema-gen-index 11 | 12 | war 13 | Java EE 7 Sample: jpa - schema-gen-index 14 | 15 | -------------------------------------------------------------------------------- /batch/scheduling/src/test/java/org/javaee7/batch/samples/scheduling/MyStepListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.samples.scheduling; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | 5 | import javax.batch.api.listener.AbstractStepListener; 6 | import javax.inject.Named; 7 | 8 | @Named 9 | public class MyStepListener extends AbstractStepListener { 10 | 11 | public static CountDownLatch countDownLatch = new CountDownLatch(3); 12 | 13 | @Override 14 | public void beforeStep() throws Exception { 15 | } 16 | 17 | @Override 18 | public void afterStep() throws Exception { 19 | countDownLatch.countDown(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cdi/alternatives/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | cdi 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | cdi-alternatives 12 | Java EE 7 Sample: cdi - alternatives 13 | 14 | -------------------------------------------------------------------------------- /cdi/interceptors/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | cdi 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | cdi-interceptors 12 | Java EE 7 Sample: cdi - interceptors 13 | 14 | -------------------------------------------------------------------------------- /jaxrs/jaxrs-client/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jaxrs 8 | 1.0-SNAPSHOT 9 | 10 | 11 | jaxrs-jaxrs-client 12 | war 13 | Java EE 7 Sample: jaxrs - jaxrs-client 14 | 15 | 16 | -------------------------------------------------------------------------------- /jms/jms-xa/src/main/java/org/javaee7/jms/xa/DeliveryStats.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jms.xa; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | 5 | import javax.ejb.Singleton; 6 | 7 | @Singleton 8 | public class DeliveryStats { 9 | 10 | public static CountDownLatch countDownLatch = new CountDownLatch(1); 11 | 12 | private long deliveredMessagesCount; 13 | 14 | public long getDeliveredMessagesCount() { 15 | return deliveredMessagesCount; 16 | } 17 | 18 | public void messageDelivered() { 19 | deliveredMessagesCount++; 20 | } 21 | 22 | public void reset() { 23 | deliveredMessagesCount = 0L; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jpa/jpa-converter/src/main/java/org/javaee7/jpa/converter/CreditCardConverter.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.converter; 2 | 3 | import javax.persistence.AttributeConverter; 4 | import javax.persistence.Converter; 5 | 6 | /** 7 | * @author Arun Gupta 8 | */ 9 | @Converter 10 | public class CreditCardConverter implements AttributeConverter { 11 | 12 | @Override 13 | public String convertToDatabaseColumn(CreditCard attribute) { 14 | return attribute.toString(); 15 | } 16 | 17 | @Override 18 | public CreditCard convertToEntityAttribute(String card) { 19 | return new CreditCard(card); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jpa/schema-gen-scripts/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (7, 'Howard') 8 | INSERT INTO EMPLOYEE_SCHEMA_GEN_SCRIPTS("ID", "NAME") VALUES (8, 'Priya') -------------------------------------------------------------------------------- /servlet/error-mapping/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | servlet 8 | 1.0-SNAPSHOT 9 | 10 | 11 | servlet-error-mapping 12 | war 13 | 14 | Java EE 7 Sample: servlet - error-mapping 15 | 16 | -------------------------------------------------------------------------------- /jpa/schema-gen-metadata/src/main/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (1, 'Penny') 2 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (2, 'Sheldon') 3 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (3, 'Amy') 4 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (4, 'Leonard') 5 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (5, 'Bernadette') 6 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (6, 'Raj') 7 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (7, 'Howard') 8 | INSERT INTO EMPLOYEE_SCHEMA_GEN_METADATA("ID", "NAME") VALUES (8, 'Priya') -------------------------------------------------------------------------------- /servlet/simple-servlet/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | servlet 8 | 1.0-SNAPSHOT 9 | 10 | 11 | servlet-simple-servlet 12 | war 13 | 14 | Java EE 7 Sample: servlet - simple-servlet 15 | 16 | -------------------------------------------------------------------------------- /jms/jms-batch/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | jms 7 | 1.0-SNAPSHOT 8 | 9 | 10 | jms-jms-batch 11 | Java EE 7 Sample: jms - jms-batch 12 | ItemReader reading from durable subscription 13 | 14 | -------------------------------------------------------------------------------- /batch/flow/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | batch 7 | 1.0-SNAPSHOT 8 | 9 | 10 | batch-flow 11 | war 12 | Java EE 7 Sample: batch - flow 13 | Batch DSL - Flow 14 | 15 | 16 | -------------------------------------------------------------------------------- /cdi/decorators-builtin-beans/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | cdi 7 | 1.0-SNAPSHOT 8 | 9 | 10 | cdi-decorators-builtin-beans 11 | war 12 | Java EE 7 Sample: cdi - decorators - built-in beans 13 | 14 | -------------------------------------------------------------------------------- /ejb/async-ejb/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | ejb 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | ejb-async-ejb 12 | war 13 | Java EE 7 Sample: ejb - async-ejb 14 | 15 | -------------------------------------------------------------------------------- /jaspic/invoke-ejb-cdi/src/main/java/org/javaee7/jaspic/invoke/bean/CDIBean.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.invoke.bean; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | import javax.inject.Inject; 5 | import javax.inject.Named; 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | @Named 9 | @RequestScoped 10 | public class CDIBean { 11 | 12 | @Inject 13 | private HttpServletRequest request; 14 | 15 | public String getText() { 16 | return "Called from CDI"; 17 | } 18 | 19 | public void setTextViaInjectedRequest() { 20 | request.setAttribute("text", "Called from CDI via injected request"); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jpa/listeners-injection/src/main/java/org/javaee7/jpa/listeners/RatingService.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.listeners; 2 | 3 | import javax.ejb.Stateless; 4 | import javax.persistence.EntityManager; 5 | import javax.persistence.PersistenceContext; 6 | 7 | /** 8 | * @author Kuba Marchwicki 9 | */ 10 | 11 | @Stateless 12 | public class RatingService { 13 | @PersistenceContext 14 | private EntityManager em; 15 | 16 | public Integer movieRating(String name) { 17 | return em.createNamedQuery(Rating.FIND_BY_NAME, Rating.class) 18 | .setParameter("name", name) 19 | .getSingleResult() 20 | .getRating(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jsf/http-get/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jsf 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jsf-http-get 12 | war 13 | Java EE 7 Sample: jsf - http-get 14 | 15 | -------------------------------------------------------------------------------- /websocket/websocket-vs-rest-payload/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 2 | 3 | 4 | 5 | 6 | REST vs WebSocket - Payload 7 | 8 | 9 | 10 | 11 |

REST vs WebSocket - Payload

12 | 13 | Use Adavanced REST Client extension to send requests.
14 | Capture REST/HTTP headers using the extension.
15 | Capture WebSocket headers using Wireshark. 16 | 17 | 18 | -------------------------------------------------------------------------------- /jaspic/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: JASPIC - Java Authentication Service Provider Interface for Containers# 2 | 3 | The [JSR 196](https://jcp.org/en/jsr/detail?id=196) seeks to define a standard interface by which authentication modules may be integrated with containers and such that these modules may establish the authentication identities used by containers. 4 | 5 | ## Samples ## 6 | 7 | - async-authentication 8 | - basic-authentication 9 | - ejb-propagation 10 | - lifecycle 11 | - register-session 12 | - wrapping 13 | 14 | ## How to run 15 | 16 | More information on how to run can be found at: 17 | 18 | 19 | -------------------------------------------------------------------------------- /jms/jms-xa/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | jms 7 | org.javaee7 8 | 1.0-SNAPSHOT 9 | 10 | jms-jms-xa 11 | war 12 | Java EE 7 Sample: jms - jms-xa 13 | Arquillian test for JMS XA 14 | 15 | -------------------------------------------------------------------------------- /jpa/extended-pc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jpa 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jpa-extended-pc 12 | war 13 | Java EE 7 Sample: jpa - extended-pc 14 | 15 | -------------------------------------------------------------------------------- /jpa/jpa-converter/src/main/java/org/javaee7/jpa/converter/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.converter; 2 | 3 | import java.util.List; 4 | import javax.ejb.Stateless; 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.PersistenceContext; 7 | 8 | /** 9 | * @author Arun Gupta 10 | */ 11 | @Stateless 12 | public class EmployeeRepository { 13 | 14 | @PersistenceContext 15 | private EntityManager em; 16 | 17 | public void persist(Employee e) { 18 | em.persist(e); 19 | } 20 | 21 | public List all() { 22 | return em.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test-utils/src/main/java/org/javaee7/RemoteEJBContextFactory.java: -------------------------------------------------------------------------------- 1 | /** Copyright Payara Services Limited **/ 2 | package org.javaee7; 3 | 4 | import java.util.Iterator; 5 | import java.util.ServiceLoader; 6 | 7 | public class RemoteEJBContextFactory { 8 | 9 | public static RemoteEJBContextProvider getProvider() { 10 | 11 | ServiceLoader loader = ServiceLoader.load(RemoteEJBContextProvider.class); 12 | 13 | Iterator providers = loader.iterator(); 14 | 15 | if (!providers.hasNext()) { 16 | return null; 17 | } 18 | 19 | return providers.next(); 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /websocket/chat/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.javaee7 5 | websocket 6 | 1.0-SNAPSHOT 7 | 8 | 9 | org.javaee7 10 | websocket-chat 11 | 12 | war 13 | Java EE 7 Sample: websocket - chat 14 | 15 | -------------------------------------------------------------------------------- /websocket/endpoint-async/src/main/java/org/javaee7/websocket/endpoint/async/MyAsyncEndpointByteBufferClient.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.websocket.endpoint.async; 2 | 3 | import java.nio.ByteBuffer; 4 | import javax.websocket.ClientEndpoint; 5 | import javax.websocket.OnMessage; 6 | 7 | /** 8 | * 9 | * @author Jacek Jackowiak 10 | */ 11 | @ClientEndpoint 12 | public class MyAsyncEndpointByteBufferClient { 13 | 14 | private ByteBuffer receivedMessage; 15 | 16 | @OnMessage 17 | public void onMessage(ByteBuffer msg) { 18 | receivedMessage = msg; 19 | } 20 | 21 | public ByteBuffer getReceivedMessage() { 22 | return receivedMessage; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /cdi/alternatives-priority/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | cdi 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | cdi-alternatives-priority 12 | Java EE 7 Sample: cdi - alternatives-priority 13 | 14 | -------------------------------------------------------------------------------- /cdi/interceptors-priority/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | cdi 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | cdi-interceptors-priority 12 | Java EE 7 Sample: cdi - interceptors-priority 13 | 14 | -------------------------------------------------------------------------------- /concurrency/managedexecutor/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | concurrent/myExecutor 9 | 10 | 11 | javax.enterprise.concurrent.ManagedExecutorService 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ejb/remote/roles-allowed-ssl/src/main/resources/META-INF/application.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | myapp 8 | 9 | 10 | myEJB.jar 11 | 12 | 13 | 14 | 15 | test.war 16 | /test 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /jaxrs/beanparam/src/main/java/org/javaee7/jaxrs/beanparam/MyPathParams.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.beanparam; 2 | 3 | import javax.ws.rs.PathParam; 4 | 5 | /** 6 | * @author xcoulon 7 | * 8 | */ 9 | public class MyPathParams { 10 | 11 | @PathParam("id1") 12 | private String id1; 13 | 14 | private String id2; 15 | 16 | public String getId1() { 17 | return id1; 18 | } 19 | 20 | public void setId1(String id1) { 21 | this.id1 = id1; 22 | } 23 | 24 | public String getId2() { 25 | return id2; 26 | } 27 | 28 | @PathParam("id2") 29 | public void setId2(String id2) { 30 | this.id2 = id2; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jaxrs/singleton/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | jaxrs 7 | org.javaee7 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jaxrs-singleton 12 | war 13 | Java EE 7 Sample: jaxrs - singleton 14 | 15 | -------------------------------------------------------------------------------- /jpa/aggregate-function-in-select/src/main/java/org/javaee7/jpa/aggregate_function_in_select/entity/AggregatedTestEntity.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.aggregate_function_in_select.entity; 2 | 3 | /** 4 | * A very simple DTO that will be used to aggregate TestEnity to 5 | * 6 | * @author Arjan Tijms 7 | * 8 | */ 9 | public class AggregatedTestEntity { 10 | 11 | private String values; 12 | 13 | public AggregatedTestEntity(String values) { 14 | this.values = values; 15 | } 16 | 17 | public String getValues() { 18 | return values; 19 | } 20 | 21 | public void setValues(String values) { 22 | this.values = values; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jpa/entitygraph/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jpa 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jpa-entitygraph 12 | war 13 | Java EE 7 Sample: jpa - entitygraph 14 | 15 | -------------------------------------------------------------------------------- /jpa/ordercolumn/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jpa 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jpa-ordercolumn 12 | war 13 | Java EE 7 Sample: jpa - ordercolumn 14 | 15 | -------------------------------------------------------------------------------- /batch/split/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | batch 7 | 1.0-SNAPSHOT 8 | 9 | 10 | batch-split 11 | war 12 | Java EE 7 Sample: batch - split 13 | Batch JSL - Splitting Steps 14 | 15 | 16 | -------------------------------------------------------------------------------- /jaxrs/beanparam/src/main/java/org/javaee7/jaxrs/beanparam/MyQueryParams.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxrs.beanparam; 2 | 3 | import javax.ws.rs.QueryParam; 4 | 5 | /** 6 | * @author xcoulon 7 | * 8 | */ 9 | public class MyQueryParams { 10 | 11 | @QueryParam("param1") 12 | private String param1; 13 | 14 | @QueryParam("param2") 15 | private String param2; 16 | 17 | @QueryParam("param3") 18 | private String param3; 19 | 20 | public String getParam1() { 21 | return param1; 22 | } 23 | 24 | public String getParam2() { 25 | return param2; 26 | } 27 | 28 | public String getParam3() { 29 | return param3; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /jaxws/jaxws-endpoint/src/main/java/org/javaee7/jaxws/endpoint/EBookStore.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaxws.endpoint; 2 | 3 | import java.util.List; 4 | 5 | import javax.jws.WebMethod; 6 | import javax.jws.WebService; 7 | 8 | /** 9 | * 10 | * @author Fermin Gallego 11 | * 12 | */ 13 | @WebService 14 | public interface EBookStore { 15 | 16 | @WebMethod 17 | String welcomeMessage(String name); 18 | 19 | @WebMethod 20 | List findEBooks(String text); 21 | 22 | @WebMethod 23 | EBook takeBook(String title); 24 | 25 | @WebMethod 26 | void saveBook(EBook eBook); 27 | 28 | @WebMethod 29 | EBook addAppendix(EBook eBook, int appendixPages); 30 | } 31 | -------------------------------------------------------------------------------- /batch/decision/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | batch 7 | 1.0-SNAPSHOT 8 | 9 | 10 | batch-decision 11 | war 12 | Java EE 7 Sample: batch - decision 13 | Batch DSL - Decision 14 | 15 | 16 | -------------------------------------------------------------------------------- /jaxrs/readerwriter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jaxrs 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jaxrs-readerwriter 12 | war 13 | Java EE 7 Sample: jaxrs - readerwriter 14 | 15 | -------------------------------------------------------------------------------- /jpa/unsynchronized-pc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jpa 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jpa-unsynchronized-pc 12 | war 13 | Java EE 7 Sample: jpa - unsynchronized-pc 14 | 15 | -------------------------------------------------------------------------------- /json/object-builder/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | json 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | json-object-builder 12 | war 13 | Java EE 7 Sample: json - object-builder 14 | 15 | -------------------------------------------------------------------------------- /batch/chunk-exception/src/main/java/org/javaee7/batch/chunk/exception/MyRetryReadListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.batch.chunk.exception; 2 | 3 | import javax.batch.api.chunk.listener.RetryReadListener; 4 | import javax.inject.Named; 5 | 6 | /** 7 | * @author Roberto Cortez 8 | */ 9 | @Named 10 | public class MyRetryReadListener implements RetryReadListener { 11 | @Override 12 | public void onRetryReadException(Exception ex) throws Exception { 13 | ChunkExceptionRecorder.retryReadExecutions++; 14 | ChunkExceptionRecorder.chunkExceptionsCountDownLatch.countDown(); 15 | System.out.println("MyRetryReadListener.onRetryReadException " + ex.getMessage()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /interceptor/around-construct/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | interceptor 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | interceptor-around-construct 12 | Java EE 7 Sample: interceptor - around-construct 13 | 14 | -------------------------------------------------------------------------------- /jaxrs/jaxrs-endpoint/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jaxrs 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jaxrs-jaxrs-endpoint 12 | war 13 | Java EE 7 Sample: jaxrs - jaxrs-endpoint 14 | 15 | -------------------------------------------------------------------------------- /servlet/programmatic-registration/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | servlet 8 | 1.0-SNAPSHOT 9 | 10 | 11 | servlet-programmatic-registration 12 | war 13 | 14 | Java EE 7 Sample: servlet - programmatic-registration 15 | 16 | -------------------------------------------------------------------------------- /cdi/events-conditional-reception/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | cdi 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | cdi-events-conditional-reception 12 | Java EE 7 Sample: cdi - events-conditional-reception 13 | 14 | -------------------------------------------------------------------------------- /cdi/interceptors-priority/src/main/java/org/javaee7/cdi/interceptors/priority/MyInterceptorBinding.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.interceptors.priority; 2 | 3 | import javax.interceptor.InterceptorBinding; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.Target; 7 | 8 | import static java.lang.annotation.ElementType.METHOD; 9 | import static java.lang.annotation.ElementType.TYPE; 10 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 11 | 12 | /** 13 | * @author Arun Gupta 14 | */ 15 | @Inherited 16 | @InterceptorBinding 17 | @Retention(RUNTIME) 18 | @Target({ METHOD, TYPE }) 19 | public @interface MyInterceptorBinding { 20 | } 21 | -------------------------------------------------------------------------------- /jacc/contexts/src/main/java/org/javaee7/jacc/contexts/sam/SamAutoRegistrationListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jacc.contexts.sam; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | import javax.servlet.annotation.WebListener; 5 | 6 | import org.javaee7.jaspic.common.BaseServletContextListener; 7 | import org.javaee7.jaspic.common.JaspicUtils; 8 | 9 | /** 10 | * 11 | * @author Arjan Tijms 12 | * 13 | */ 14 | @WebListener 15 | public class SamAutoRegistrationListener extends BaseServletContextListener { 16 | 17 | @Override 18 | public void contextInitialized(ServletContextEvent sce) { 19 | JaspicUtils.registerSAM(sce.getServletContext(), new TestServerAuthModule()); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /jpa/default-datasource/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jpa 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jpa-default-datasource 12 | war 13 | Java EE 7 Sample: jpa - default-datasource 14 | 15 | -------------------------------------------------------------------------------- /jpa/ordercolumn/src/main/java/org/javaee7/jpa/ordercolumn/entity/unidirectional/Child.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jpa.ordercolumn.entity.unidirectional; 2 | 3 | import static javax.persistence.GenerationType.IDENTITY; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.Id; 8 | 9 | @Entity 10 | public class Child { 11 | 12 | @Id 13 | @GeneratedValue(strategy = IDENTITY) 14 | private Long id; 15 | 16 | @SuppressWarnings("unused") 17 | private int dummy = 1; 18 | 19 | public Long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(Long id) { 24 | this.id = id; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /jpa/schema-gen-metadata/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jpa 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jpa-schema-gen-metadata 12 | war 13 | Java EE 7 Sample: jpa - schema-gen-metadata 14 | 15 | -------------------------------------------------------------------------------- /websocket/javase-client/nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | run 5 | 6 | jar 7 | 8 | 9 | process-classes 10 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 11 | 12 | 13 | -classpath %classpath org.javaee7.websocket.javase.client.Client 14 | java 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /batch/scheduling/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.javaee7 6 | batch 7 | 1.0-SNAPSHOT 8 | 9 | 10 | batch-scheduling 11 | war 12 | Java EE 7 Sample: batch - scheduling 13 | 14 | Scheduling a Batch Job 15 | 16 | 17 | -------------------------------------------------------------------------------- /cdi/events-conditional-reception/src/main/java/org/javaee7/cdi/events/conditional/GreetingReceiver.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.cdi.events.conditional; 2 | 3 | import javax.enterprise.context.SessionScoped; 4 | import javax.enterprise.event.Observes; 5 | import javax.enterprise.event.Reception; 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @author Radim Hanus 10 | */ 11 | @SessionScoped 12 | public class GreetingReceiver implements EventReceiver, Serializable { 13 | private String greet = "Willkommen"; 14 | 15 | void receive(@Observes(notifyObserver = Reception.IF_EXISTS) String greet) { 16 | this.greet = greet; 17 | } 18 | 19 | @Override 20 | public String getGreet() { 21 | return greet; 22 | } 23 | } -------------------------------------------------------------------------------- /cdi/nobeans-el-injection/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | cdi 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | cdi-nobeans-el-injection 12 | war 13 | Java EE 7 Sample: cdi - nobeans-el-injection 14 | 15 | -------------------------------------------------------------------------------- /jaxrs/server-negotiation/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.javaee7 7 | jaxrs 8 | 1.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | jaxrs-server-negotiation 12 | war 13 | Java EE 7 Sample: jaxrs - server-negotiation 14 | 15 | -------------------------------------------------------------------------------- /jaspic/invoke-ejb-cdi/src/main/java/org/javaee7/jaspic/invoke/sam/SamAutoRegistrationListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.invoke.sam; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | import javax.servlet.annotation.WebListener; 5 | 6 | import org.javaee7.jaspic.common.BaseServletContextListener; 7 | import org.javaee7.jaspic.common.JaspicUtils; 8 | 9 | /** 10 | * 11 | * @author Arjan Tijms 12 | * 13 | */ 14 | @WebListener 15 | public class SamAutoRegistrationListener extends BaseServletContextListener { 16 | 17 | @Override 18 | public void contextInitialized(ServletContextEvent sce) { 19 | JaspicUtils.registerSAM(sce.getServletContext(), new TestServerAuthModule()); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /websocket/endpoint-wss/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.javaee7.websocket 6 | websocket-samples 7 | 1.0-SNAPSHOT 8 | ../pom.xml 9 | 10 | 11 | org.javaee7.websocket 12 | endpoint-wss 13 | 1.0-SNAPSHOT 14 | war 15 | 16 | -------------------------------------------------------------------------------- /batch/README.md: -------------------------------------------------------------------------------- 1 | # Java EE 7 Samples: Batch # 2 | 3 | The [JSR 352](https://jcp.org/en/jsr/detail?id=352) specifies a programming model for batch applications and a runtime for scheduling and executing jobs. 4 | 5 | ## Samples ## 6 | 7 | - batchlet-simple 8 | - chunk-checkpoint 9 | - chunk-csv-database 10 | - chunk-exception 11 | - chunk-mapper 12 | - chunk-optional-processor 13 | - chunk-partition 14 | - chunk-simple 15 | - decision 16 | - flow 17 | - batch-listeners 18 | - multiple-steps 19 | - split 20 | - chunk-simple-nobeans 21 | - scheduling 22 | 23 | ## How to run 24 | 25 | More information on how to run can be found at: 26 | 27 | 28 | -------------------------------------------------------------------------------- /jaspic/dispatching/src/main/java/org/javaee7/jaspic/dispatching/sam/SamAutoRegistrationListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.dispatching.sam; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | import javax.servlet.annotation.WebListener; 5 | 6 | import org.javaee7.jaspic.common.BaseServletContextListener; 7 | import org.javaee7.jaspic.common.JaspicUtils; 8 | 9 | /** 10 | * 11 | * @author Arjan Tijms 12 | * 13 | */ 14 | @WebListener 15 | public class SamAutoRegistrationListener extends BaseServletContextListener { 16 | 17 | @Override 18 | public void contextInitialized(ServletContextEvent sce) { 19 | JaspicUtils.registerSAM(sce.getServletContext(), new TestServerAuthModule()); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /jaspic/lifecycle/src/main/java/org/javaee7/jaspic/lifecycle/sam/SamAutoRegistrationListener.java: -------------------------------------------------------------------------------- 1 | package org.javaee7.jaspic.lifecycle.sam; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | import javax.servlet.annotation.WebListener; 5 | 6 | import org.javaee7.jaspic.common.BaseServletContextListener; 7 | import org.javaee7.jaspic.common.JaspicUtils; 8 | 9 | /** 10 | * 11 | * @author Arjan Tijms 12 | * 13 | */ 14 | @WebListener 15 | public class SamAutoRegistrationListener extends BaseServletContextListener { 16 | 17 | @Override 18 | public void contextInitialized(ServletContextEvent sce) { 19 | JaspicUtils.registerSAM(sce.getServletContext(), new TestLifecycleAuthModule()); 20 | } 21 | 22 | } --------------------------------------------------------------------------------