com.syncbuilder.sync
Class SyncServer

java.lang.Object
  |
  +--com.syncbuilder.service.ServiceBase
        |
        +--com.syncbuilder.sync.SyncServer

public class SyncServer
extends ServiceBase

A SyncServer is the heart of many applications which are supposed to handle connections from Palm devices. It continuously accepts connections and spawns a separate thread to handle each one.
Each of these threads runs an implementation of the SyncHandler-interface. The threads terminate when their SyncHandler is done.
The SyncServer can be controlled through ServiceControlEvents.

See Also:
ServiceControlListener, ServiceControlEvent, DispatchSyncHandler

Constructor Summary
SyncServer(ServerSocket serversock, SyncHandler synchandler, SyncContext context)
          Construct a SyncServer from an existing ServerSocket.
 
Method Summary
protected  void destroy()
           
protected  void init()
           
protected  void service()
           
 void setAcceptTimeout(int timeout)
           
 
Methods inherited from class com.syncbuilder.service.ServiceBase
addServiceStateListener, addThread, finalize, removeServiceStateListener, resume, run, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncServer

public SyncServer(ServerSocket serversock,
                  SyncHandler synchandler,
                  SyncContext context)
Construct a SyncServer from an existing ServerSocket. Each connection will be handled by one and the same instance of an implementation of the SyncHandler interface. You will have to provide that instance.
This principle will be familiar to you if you have worked with Servlets before.
The SyncServer will be inactive after its construction. You need to invoke the run()-method to awake it. After that you should control it by sending ServiceControlEvents to it.
See Also:
ServiceBase.run(), ServiceControlEvent, DispatchSyncHandler
Method Detail

setAcceptTimeout

public void setAcceptTimeout(int timeout)

init

protected void init()
             throws java.lang.Exception
Overrides:
init in class ServiceBase

destroy

protected void destroy()
                throws java.lang.Exception
Overrides:
destroy in class ServiceBase

service

protected void service()
                throws java.lang.Exception
Overrides:
service in class ServiceBase


This material is Copyrighted (C) 1999 by Tilo Christ. All Rights Reserved.