example.bluetooth.demo
Class BTImageServer

java.lang.Object
  extended by example.bluetooth.demo.BTImageServer
All Implemented Interfaces:
java.lang.Runnable

final class BTImageServer
extends java.lang.Object
implements java.lang.Runnable

Established the BT service, accepts connections and send the requested image silently.


Constructor Summary
BTImageServer(GUIImageServer parent)
          Constructs the bluetooth server, but it is initialized in the different thread to "avoid dead lock".
 
Method Summary
(package private)  boolean changeImageInfo(java.lang.String name, boolean isPublished)
          Updates the service record with the information about the published images availability.
(package private)  void destroy()
          Destroy a work with bluetooth - exits the accepting thread and close notifier.
 void run()
          Accepts a new client and send him/her a requested image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTImageServer

BTImageServer(GUIImageServer parent)
Constructs the bluetooth server, but it is initialized in the different thread to "avoid dead lock".

Method Detail

run

public void run()
Accepts a new client and send him/her a requested image.

Specified by:
run in interface java.lang.Runnable

changeImageInfo

boolean changeImageInfo(java.lang.String name,
                        boolean isPublished)
Updates the service record with the information about the published images availability.

This method is invoked after the caller has checked already that the real action should be done.

Returns:
true if record was updated successfully, false otherwise.

destroy

void destroy()
Destroy a work with bluetooth - exits the accepting thread and close notifier.