org.glassfish.jersey.examples.jersey_ejb.resources
Class MessageBoardResourceBean

java.lang.Object
  extended by org.glassfish.jersey.examples.jersey_ejb.resources.MessageBoardResourceBean

public class MessageBoardResourceBean
extends Object

A stateless EJB bean to handle REST requests to the messages resource. Messages are stored in the injected EJB singleton instance.

Author:
Pavel Bucek (pavel.bucek at oracle.com)

Constructor Summary
MessageBoardResourceBean()
           
 
Method Summary
 javax.ws.rs.core.Response addMessage(String msg)
           
 void deleteMessage(int msgNum)
           
 Message getMessage(int msgNum)
           
 List<Message> getMessages()
          Returns a list of all messages stored in the internal message holder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageBoardResourceBean

public MessageBoardResourceBean()
Method Detail

getMessages

@GET
public List<Message> getMessages()
Returns a list of all messages stored in the internal message holder.


addMessage

@POST
public javax.ws.rs.core.Response addMessage(String msg)
                                     throws URISyntaxException
Throws:
URISyntaxException

getMessage

@Path(value="{msgNum}")
@GET
public Message getMessage(@PathParam(value="msgNum")
                                   int msgNum)

deleteMessage

@Path(value="{msgNum}")
@DELETE
public void deleteMessage(@PathParam(value="msgNum")
                                      int msgNum)
                   throws CustomNotFoundException
Throws:
CustomNotFoundException


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.