Integrating JAX-RS 2.0 with Atom

About this task

JAX-RS 2.0 can use Apache Abdera to add Atom support to WebSphere® Application Server tradicional. Because GitHub does not support any sample for WebSphere Application Server tradicional now, use the Liberty samples on GitHub instead. You can also use the Liberty sample build results for WebSphere Application Server tradicional directly. To add JAX-RS 2.0 with Atom and run the application, proceed with the following steps:

Procedure

  1. To add Atom support to WebSphere Application Server tradicional, register the Feed and Entry providers that are based on Apache Abdera with a jaxrs endpoint in the Application subclasses. Use the following example as reference:
    package net.wasdev.wlp.sample.abdera.jaxrs.atom;
    
    import java.util.HashSet;
    import java.util.Set;
    
    import javax.ws.rs.core.Application;
    
    import net.wasdev.wlp.sample.abdera.jaxrs.atom.resource.BlogService;
    
    public class AtomApplication extends Application {
    
    	@Override
    	public Set<Class<?>> getClasses(){
    		Set<Class<?>> list = new HashSet<Class<?>>();
    		
    		list.add(BlogService.class);		
    
    		return list;
    		
    	}
    	
    	@Override
    	public Set<Object> getSingletons(){
    		Set<Object> list = new HashSet<Object>();
    		
    		list.add(new AtomEntryProvider());
    		list.add(new AtomFeedProvider());		
    		
    		return list;
    	}
    	
    
    	
    	
    	
    
    }
    For more information about processing Atom data, see AtomEntryProvider source code example and AtomFeedProvider source code example.
  2. Build the Liberty samples on GitHub with Gradle or Apache Maven. For more information about Gradle and Apache Maven, see http://gradle.org/ and http://maven.apache.org/.

    You can use two ways of building samples on GitHub. For instructions, see the following websites:

    For example, when you use Maven to build, you must add the two abdera dependencies to the pom.xml file as follows. This action ensures the application to call them.

    <dependency>
    	<groupId>org.apache.abdera</groupId>
    	<artifactId>abdera-core</artifactId>
    	<version>1.1.3</version>
    </dependency>
    <dependency>
    	<groupId>org.apache.abdera</groupId
    	<artifactId>abdera-parser</artifactId>
    	<version>1.1.3</version>
    </dependency>
  3. Run the application.
    1. Deploy the build result (WAR file) on the WebSphere Application Server tradicional adminConsole: Applications->Application types->WebSphere enterprise applications->Install.
    2. Start the application on the WebSphere Application Server tradicional adminConsole: Applications->Application types->WebSphere enterprise applications->Start.

Ícone que indica o tipo de tópico Tópico de Tarefa



Ícone de registro de data e hora Última atualização: July 9, 2016 7:57
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twbs_jaxrs2
Nome do arquivo: twbs_jaxrs2.0_atom.html