com.buglabs.bug.module.motion
Class MotionModlet

java.lang.Object
  extended by com.buglabs.bug.module.motion.MotionModlet
All Implemented Interfaces:
IMotionSubject, IModlet, IModuleControl

public class MotionModlet
extends java.lang.Object
implements IModlet, IMotionSubject, IModuleControl


Constructor Summary
MotionModlet(org.osgi.framework.BundleContext context, int slotId, java.lang.String moduleName)
           
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.String getModuleId()
          Return the MODULE ID.
 java.lang.String getModuleName()
          Get the human-readable name of this module.
 java.util.List getModuleProperties()
          Return a list of IModuleProperty elements.
 int getSlotId()
           
 void notifyEventListeners(InputEvent[] events)
           
 void notifyObservers()
           
 void register(IMotionEventListener listener)
           
 void register(IMotionObserver obs)
           
 boolean setModuleProperty(IModuleProperty property)
          Set a property.
 void setup()
          Connect to any devices or do any initialization.
 void start()
          Begin modlet.
 void stop()
          Unregister services and release any resources.
 void unregister(IMotionEventListener listener)
           
 void unregister(IMotionObserver obs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MotionModlet

public MotionModlet(org.osgi.framework.BundleContext context,
                    int slotId,
                    java.lang.String moduleName)
Method Detail

setup

public void setup()
           throws java.lang.Exception
Description copied from interface: IModlet
Connect to any devices or do any initialization. This is a good place to throw an exception if the expected hardware environment is not valid.

Specified by:
setup in interface IModlet
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Description copied from interface: IModlet
Begin modlet. Any services that the modlet supports should be registered here.

Specified by:
start in interface IModlet
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Description copied from interface: IModlet
Unregister services and release any resources.

Specified by:
stop in interface IModlet
Throws:
java.lang.Exception

getModuleProperties

public java.util.List getModuleProperties()
Description copied from interface: IModuleControl
Return a list of IModuleProperty elements.

Specified by:
getModuleProperties in interface IModuleControl
Returns:

setModuleProperty

public boolean setModuleProperty(IModuleProperty property)
Description copied from interface: IModuleControl
Set a property. This is from a client request.

Specified by:
setModuleProperty in interface IModuleControl
Returns:

getModuleName

public java.lang.String getModuleName()
Description copied from interface: IModuleControl
Get the human-readable name of this module.

Specified by:
getModuleName in interface IModuleControl
Returns:

getModuleId

public java.lang.String getModuleId()
Description copied from interface: IModlet
Return the MODULE ID. This comes from the hardware.

Specified by:
getModuleId in interface IModlet
Returns:

getSlotId

public int getSlotId()
Specified by:
getSlotId in interface IModlet
Specified by:
getSlotId in interface IModuleControl
Returns:
Slot that the Module is currently connected to.

getDescription

public java.lang.String getDescription()

register

public void register(IMotionObserver obs)
Specified by:
register in interface IMotionSubject

unregister

public void unregister(IMotionObserver obs)
Specified by:
unregister in interface IMotionSubject

notifyObservers

public void notifyObservers()
Specified by:
notifyObservers in interface IMotionSubject

notifyEventListeners

public void notifyEventListeners(InputEvent[] events)
Specified by:
notifyEventListeners in interface IMotionSubject

register

public void register(IMotionEventListener listener)
Specified by:
register in interface IMotionSubject

unregister

public void unregister(IMotionEventListener listener)
Specified by:
unregister in interface IMotionSubject