|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cafesip.jiplet.ScopedVariables
org.cafesip.jiplet.JipletEvent
org.cafesip.jiplet.JipletSignal
public class JipletSignal
This class is used by jiplets to retrieve information about a signal it has received. External entities can interact with the jiplet by sending a "signal". A signal encapsulates any event that an external entity can send. For example, an external entity may send a message to the jiplet using a socket. If the jiplet has been programmed to receive the message, it can be received by the jiplet.
The way it works is that in the init() or any other method in the jiplet, you must initialize your connection to the external entity and create a listener for external event. For example, If your jiplet wants to receive a message from a UDP socket, you should initialize the open the socket connection and create a thread from where you can listen to the socket. When a message arrives, your listener must call the org.cafesip.jiplet.JipletContext.sendSignal() message to pass on the message to the jiplet.
The jiplet container allocates a thread from the thread pool and calls the processSignal() method of the jiplet to deliver the message. The jiplet has access to the scoped variables and can also forward the event from one jiplet to another using standard mechanisms laid out by the jiplet container.
| Constructor Summary | |
|---|---|
JipletSignal()
A constructor for this class. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getEventObject()
|
Jiplet |
getJiplet()
|
javax.sip.message.Message |
getMessage()
|
JipletSession |
getSession(boolean create)
Get the session object associated with this event. |
void |
setEventObject(java.lang.Object eventObject)
The code calling the JipletContext.sendSignal() method to signal an event can pass any object to the jiplet by calling this setter method. |
protected void |
setJiplet(Jiplet jiplet)
|
void |
setMessage(javax.sip.message.Message message)
The code calling the JipletContext.sendSignal() method to signal an asscoiated SIP message. |
| Methods inherited from class org.cafesip.jiplet.JipletEvent |
|---|
getForward, getJipletContext, getSession, setForward, setJipletContext |
| Methods inherited from class org.cafesip.jiplet.ScopedVariables |
|---|
getAttribute, getAttributeNames, removeAttribute, setAttribute |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JipletSignal()
| Method Detail |
|---|
public java.lang.Object getEventObject()
public void setEventObject(java.lang.Object eventObject)
eventObject - The eventObject to set.public javax.sip.message.Message getMessage()
public void setMessage(javax.sip.message.Message message)
message - The message to set.public JipletSession getSession(boolean create)
create - create the session object if it does not exist.
public Jiplet getJiplet()
protected void setJiplet(Jiplet jiplet)
jiplet - The jiplet to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||