|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lyra.Host.Updater
public class Updater
This class will notify various clients on updates originating from the host itself. In order to create segregation the Updater will run in its own thread and using another connection to the host.
UpdateEvent
,
UpdateListener
,
Terminus
,
LossListener
Field Summary | |
---|---|
private static java.lang.String |
CLASS
|
(package private) java.util.List<UpdateListener> |
Clients
|
(package private) java.util.List<UpdateListener> |
Core
|
(package private) java.util.Map<java.lang.String,java.lang.String> |
Details
|
(package private) Terminus |
Host
|
(package private) Status |
Information
|
(package private) java.util.Map<java.lang.String,java.lang.String> |
Lang
|
(package private) Ledger |
Logger
|
private boolean |
Process
|
Constructor Summary | |
---|---|
Updater(Ledger logger,
java.util.Map<java.lang.String,java.lang.String> details,
java.util.Map<java.lang.String,java.lang.String> lang)
Core constructor which will should be making use of its own instance of Host |
Method Summary | |
---|---|
void |
addCoreListener(UpdateListener l)
Adds an UpdateListener to the updater, a core client will always be executed first. |
void |
addUpdateListener(UpdateListener l)
Adds an UpdateListener to the updater. |
protected void |
fireUpdateRequired(UpdateEvent update)
Notifies all listeners that have registered interest for notification on this event type. |
UpdateListener[] |
getCoreListeners()
Returns an array of all the UpdateListeners added to this class with addCoreListener(), a core client will always be executed first. |
UpdateListener[] |
getUpdateListeners()
Returns an array of all the UpdateListeners added to this class with addUpdateListener(). |
void |
hostLost(LossEvent e)
Notifies a client that the connection to the Music Player Daemon (MPD) has been interrupted. |
void |
removeCoreListener(UpdateListener l)
Removes an UpdateListener from the updater, a core client will always be executed first. |
void |
removeUpdateListener(UpdateListener l)
Removes an UpdateListener from the updater. |
void |
run()
|
Status |
startUpdate()
There is no sense in continuing with the process unless we can actually perform our task. |
void |
stopUpdate()
External process ability to kill off the thread cleanly and without issue used primarily for when the application is closing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.List<UpdateListener> Clients
java.util.List<UpdateListener> Core
Ledger Logger
Terminus Host
Status Information
java.util.Map<java.lang.String,java.lang.String> Lang
java.util.Map<java.lang.String,java.lang.String> Details
private static final java.lang.String CLASS
private boolean Process
Constructor Detail |
---|
public Updater(Ledger logger, java.util.Map<java.lang.String,java.lang.String> details, java.util.Map<java.lang.String,java.lang.String> lang)
logger
- Ledger instance to track updates in log.details
- Host connection details.lang
- Language map.Method Detail |
---|
public Status startUpdate()
public void stopUpdate()
public void run()
run
in interface java.lang.Runnable
public void hostLost(LossEvent e)
LossListener
hostLost
in interface LossListener
e
- Update notification method.UpdateEvent
public void addCoreListener(UpdateListener l)
l
- Class implementing the UpdateListener interface.public void removeCoreListener(UpdateListener l)
l
- Instance of class implementing the UpdateListener interface.public UpdateListener[] getCoreListeners()
public void addUpdateListener(UpdateListener l)
l
- Class implementing the UpdateListener interface.public void removeUpdateListener(UpdateListener l)
l
- Instance of class implementing the UpdateListener interface.public UpdateListener[] getUpdateListeners()
protected void fireUpdateRequired(UpdateEvent update)
update
- The UpdateEvent object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |