org.jivesoftware.sparkimpl.preference.sounds
Class SoundPlugin

java.lang.Object
  extended by org.jivesoftware.sparkimpl.preference.sounds.SoundPlugin
All Implemented Interfaces:
Plugin, ChatRoomListener, MessageListener

public class SoundPlugin
extends java.lang.Object
implements Plugin, MessageListener, ChatRoomListener


Constructor Summary
SoundPlugin()
           
 
Method Summary
 boolean canShutDown()
          This method is invoked by the PluginManager before Spark terminates.
 void chatRoomActivated(ChatRoom room)
          Invoked by ChatRooms when a ChatRoom has been activated.
 void chatRoomClosed(ChatRoom room)
          Invoke by ChatRooms when a ChatRoom has been closed.
 void chatRoomLeft(ChatRoom room)
          Invoked by ChatRooms when a ChatRoom has been left, but not closed.
 void chatRoomOpened(ChatRoom room)
          Invoked by ChatRooms when a new ChatRoom has been opened.
 void initialize()
          Invoked by the PluginManager after the instance of the Plugin is instantiated.
 void messageReceived(ChatRoom room, org.jivesoftware.smack.packet.Message message)
          Invoked by the ChatRoom when it is receives a new message.
 void messageSent(ChatRoom room, org.jivesoftware.smack.packet.Message message)
          Invoked by the ChatRoom when a new message has been sent.
 void shutdown()
          This method is invoked by the PluginManager when Spark wishes you to remove any temporary resources (in memory) such as installed components, or settings.
 void uninstall()
          This method is invoked by the PluginManager when a Spark user asks that this plugin be uninstalled.
 void userHasJoined(ChatRoom room, java.lang.String userid)
          Invoked by ChatRooms when a person has joined a chat room.
 void userHasLeft(ChatRoom room, java.lang.String userid)
          Invoked by ChatRooms when a person has left a chat room.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundPlugin

public SoundPlugin()
Method Detail

initialize

public void initialize()
Description copied from interface: Plugin
Invoked by the PluginManager after the instance of the Plugin is instantiated. When invoked, The Plugin should register with whatever listeners they may need to use or are required for use during this classes lifecycle. Plugin authors should take care to ensure that any extraneous initialization is not preformed on this method, and any startup code that can be delayed until a later time is delayed, as the Plugin's are synchronously initialized during the startup of Spark, and each Plugin has the potential to negatively impact the startup time of the product.

Specified by:
initialize in interface Plugin
See Also:
PluginManager

messageReceived

public void messageReceived(ChatRoom room,
                            org.jivesoftware.smack.packet.Message message)
Description copied from interface: MessageListener
Invoked by the ChatRoom when it is receives a new message.

Specified by:
messageReceived in interface MessageListener
Parameters:
room - the ChatRoom the message was sent to.
message - the message received.
See Also:
ChatRoom

messageSent

public void messageSent(ChatRoom room,
                        org.jivesoftware.smack.packet.Message message)
Description copied from interface: MessageListener
Invoked by the ChatRoom when a new message has been sent.

Specified by:
messageSent in interface MessageListener
Parameters:
room - the ChatRoom that sent the message.
message - the message sent.
See Also:
ChatRoom

shutdown

public void shutdown()
Description copied from interface: Plugin
This method is invoked by the PluginManager when Spark wishes you to remove any temporary resources (in memory) such as installed components, or settings. Any non java resources (file handles, database connections, etc) which are still being held by this Plugin should be released by this method immediately. This method is not guaranteed to be called, but on normal terminations of Spark, this method will be invoked.

Specified by:
shutdown in interface Plugin

canShutDown

public boolean canShutDown()
Description copied from interface: Plugin
This method is invoked by the PluginManager before Spark terminates. Plugin's should NOT use this method to release resources. They should only use this method to give users the opportunity to cancel the exit process if there is some process started by this plugin still running.

Implementations should return false to cancel the shutdown process.

Specified by:
canShutDown in interface Plugin

chatRoomOpened

public void chatRoomOpened(ChatRoom room)
Description copied from interface: ChatRoomListener
Invoked by ChatRooms when a new ChatRoom has been opened.

Specified by:
chatRoomOpened in interface ChatRoomListener
Parameters:
room - - the ChatRoom that has been opened.
See Also:
ChatContainer

chatRoomLeft

public void chatRoomLeft(ChatRoom room)
Description copied from interface: ChatRoomListener
Invoked by ChatRooms when a ChatRoom has been left, but not closed.

Specified by:
chatRoomLeft in interface ChatRoomListener
Parameters:
room - - the ChatRoom that has been left.
See Also:
ChatContainer

chatRoomClosed

public void chatRoomClosed(ChatRoom room)
Description copied from interface: ChatRoomListener
Invoke by ChatRooms when a ChatRoom has been closed.

Specified by:
chatRoomClosed in interface ChatRoomListener
Parameters:
room - - the ChatRoom that has been closed.

chatRoomActivated

public void chatRoomActivated(ChatRoom room)
Description copied from interface: ChatRoomListener
Invoked by ChatRooms when a ChatRoom has been activated. i.e. it has already been opened, but was deactivated when the user selected a new chat room, but now has selected the old one.

Specified by:
chatRoomActivated in interface ChatRoomListener
Parameters:
room - - the ChatRoom that has been selected.

userHasJoined

public void userHasJoined(ChatRoom room,
                          java.lang.String userid)
Description copied from interface: ChatRoomListener
Invoked by ChatRooms when a person has joined a chat room.

Specified by:
userHasJoined in interface ChatRoomListener
Parameters:
room - - the chat room the person has joined
userid - - the userid of the person who has joined

userHasLeft

public void userHasLeft(ChatRoom room,
                        java.lang.String userid)
Description copied from interface: ChatRoomListener
Invoked by ChatRooms when a person has left a chat room.

Specified by:
userHasLeft in interface ChatRoomListener
Parameters:
room - - the chat room the person has left
userid - - the userid of the person who has left

uninstall

public void uninstall()
Description copied from interface: Plugin
This method is invoked by the PluginManager when a Spark user asks that this plugin be uninstalled. Before this method is called, you will need to release all your in-memory resources in the #shutdown method. This method should be used to remove on disk resources such as files, images, etc.

Specified by:
uninstall in interface Plugin