|
Whack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.whack.ExternalComponent
public class ExternalComponent
ExternalComponents are responsible for connecting and authenticating with a remote server and for sending and processing received packets. In fact, an ExternalComponent is a wrapper on a Component that provides remote connection capabilities. The actual processing of the packets is done by the wrapped Component.
Constructor Summary | |
---|---|
ExternalComponent(org.xmpp.component.Component component,
ExternalComponentManager manager)
|
|
ExternalComponent(org.xmpp.component.Component component,
ExternalComponentManager manager,
int maxThreads)
|
Method Summary | |
---|---|
void |
connect(String host,
int port,
String subdomain)
Generates a connection with the server and tries to authenticate. |
void |
connectionLost()
Notification message that the connection with the server was lost unexpectedly. |
org.xmpp.component.Component |
getComponent()
|
String |
getDescription()
Returns the description of this component. |
String |
getDomain()
Returns the domain provided by this component in the connected server. |
String |
getName()
Returns the name of this component. |
String |
getSubdomain()
Returns the subdomain provided by this component in the connected server. |
void |
initialize(org.xmpp.packet.JID jid,
org.xmpp.component.ComponentManager componentManager)
Initializes this component with a ComponentManager and the JID that this component is available at (e.g. |
void |
processPacket(org.xmpp.packet.Packet packet)
Processes a packet sent to this Component. |
void |
send(org.xmpp.packet.Packet packet)
|
void |
shutdown()
Notification message indicating that the component will stop receiving incoming packets. |
void |
start()
Notification message indicating that the component will start receiving incoming packets. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExternalComponent(org.xmpp.component.Component component, ExternalComponentManager manager)
public ExternalComponent(org.xmpp.component.Component component, ExternalComponentManager manager, int maxThreads)
Method Detail |
---|
public void connect(String host, int port, String subdomain) throws org.xmpp.component.ComponentException
host
- the host to connect with.port
- the port to use.subdomain
- the subdomain that this component will be handling.
org.xmpp.component.ComponentException
- if an error happens during the connection and authentication steps.public org.xmpp.component.Component getComponent()
public String getName()
org.xmpp.component.Component
getName
in interface org.xmpp.component.Component
public String getDescription()
org.xmpp.component.Component
getDescription
in interface org.xmpp.component.Component
public String getDomain()
public String getSubdomain()
public void processPacket(org.xmpp.packet.Packet packet)
org.xmpp.component.Component
processPacket
in interface org.xmpp.component.Component
packet
- the packet.ComponentManager.sendPacket(Component, Packet)
public void send(org.xmpp.packet.Packet packet)
public void initialize(org.xmpp.packet.JID jid, org.xmpp.component.ComponentManager componentManager) throws org.xmpp.component.ComponentException
org.xmpp.component.Component
The initialization code must not rely on receiving packets from the server since the component has not been fully initialized yet. This means that at this point the component must not rely on information that is obtained from the server such us discovered items.
initialize
in interface org.xmpp.component.Component
jid
- the XMPP address that this component is available at.componentManager
- the component manager.
org.xmpp.component.ComponentException
- if an error occured while initializing the component.public void start()
org.xmpp.component.Component
It is likely that most of the component will leave this method empty.
start
in interface org.xmpp.component.Component
public void shutdown()
org.xmpp.component.Component
In the case of connection to the server was lost, the External Component will keep
trying to reconnect to the server. When reconnection is successful the Component.start()
event will be sent to the component.
shutdown
in interface org.xmpp.component.Component
public void connectionLost()
|
Whack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |