de.enough.polish.rmi.bluetooth
Class SppServer

java.lang.Object
  extended by java.lang.Thread
      extended by de.enough.polish.rmi.bluetooth.SppServer
All Implemented Interfaces:
Runnable

public class SppServer
extends Thread

Waits for incoming serial port protocol connections.

Copyright Enough Software 2008

Author:
Robert Virkus, j2mepolish@enough.de

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SppServer(SppRemoteService service, String url)
          Creates a new L2CAP Server
 
Method Summary
static String generateLocalUrl(String uuid)
          Generates the URL that fits for the given UUID
 void requestStop()
          Requests to stop this server at the next possible moment
 void run()
          Waits for incoming connections
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SppServer

public SppServer(SppRemoteService service,
                 String url)
Creates a new L2CAP Server

Parameters:
service - the service
url - the connection URL
Method Detail

generateLocalUrl

public static String generateLocalUrl(String uuid)
                               throws javax.bluetooth.BluetoothStateException
Generates the URL that fits for the given UUID

Parameters:
uuid - the UUID
Returns:
the local connection URL for establishing a serial port protocol based service
Throws:
javax.bluetooth.BluetoothStateException - when the URL could not be generated

run

public void run()
Waits for incoming connections

Specified by:
run in interface Runnable
Overrides:
run in class Thread

requestStop

public void requestStop()
Requests to stop this server at the next possible moment