borland Packages  Class Hierarchy  datastore.jdbc Package 

DataStoreServer component

java.lang.Object
   +----com.borland.datastore.jdbc.DataStoreServer

About the DataStoreServer component

Variables  Constructors  Properties  Methods  

Implements ServerStatusListener, Designable, Runnable, EventListener

Note: This is a feature of JBuilder Professional and Enterprise.

DataStoreServer listens on a given port number for requests from the remote JDataStore JDBC driver. Upon accepting a request, a connection is created that will service any further requests from that remote JDBC driver. This functionality is the core of a JDataStore JDBC server.

The server creates a ServerConnection object to represent each new connection. Objects that implement ServerStatusListener may register with the server to be notified when connections are made, connections are broken (disconnected), and when errors occur. You can control which types of events are reported.

Because access to a physical DataStore file is restricted to a single process, you must create your own custom DataStore server application if you want to add functionality. For example, in addition to servicing remote JDBC requests, you could have your server make backups at the same time every night. Another example would be if you want to access serialized file streams in the same DataStore file; these streams are not accessible through JDBC, but you could add that functionality through the DataStore API to your custom DataStore server.


DataStoreServer variables

Variables implemented in this class

DataStoreServer constructors

DataStoreServer properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

DataStoreServer methods

Methods implemented in this class

Methods implemented in java.lang.Object


DataStoreServer variables

DEFAULT_PORT

  public static final int DEFAULT_PORT = 2508
The default port number for a JDBC remote driver.

SERVER_LOG_NAME

  public static final String SERVER_LOG_NAME = "datastoreserver_log_"
The name of the JDataStore Server log.

DataStoreServer constructors

DataStoreServer()

  public DataStoreServer()
Creates a new DataStoreServer instance that will listen for activity on the default port. After optionally changing properties and registering listeners, start the DataStoreServer to activate it.

DataStoreServer properties

alive

 public final boolean isAlive()
Returns a boolean value indicating whether the server is "alive".

logStatusEvents

 public boolean isLogStatusEvents()
 public void setLogStatusEvents(boolean logStatusEvents)
Specify whether to save ServerStatusEvents to a log file.

Parameters:

logStatusEvents
- Whether to save ServerStatusEvents.

port

 public int getPort()
 public void setPort(int port)
The port on which to listen for JDBC requests. If not set, DataStoreServer.DEFAULT_PORT is used.

reportConnect

 public final boolean isReportConnect()
 public final void setReportConnect(boolean set)
Determines whether connections and disconnections are reported to registered ServerStatusListeners or ignored.

reportConnectError

 public final boolean isReportConnectError()
 public final void setReportConnectError(boolean set)
Determines whether errors regarding the instantiation, connection, or disconnection of ServerConnection objects are reported to registered ServerStatusListeners or ignored.

reportServerError

 public final boolean isReportServerError()
 public final void setReportServerError(boolean set)
Determines whether (fatal) server errors are reported to registered ServerStatusListeners or ignored.

serverConnections

 public final Vector getServerConnections()
Returns a list of current connections, represented by ServerConnection objects.

soTimeout

 public synchronized int getSoTimeout()
 public synchronized void setSoTimeout(int timeout)
Retrive setting for SO_TIMEOUT. 0 returns implies that the option is disabled (i.e., timeout of infinity).

See also: ServerSocket.getSoTimeout() Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a call to accept() for this ServerSocket will block for only this amount of time. If the timeout expires, a java.io.InterruptedIOException is raised, though the ServerSocket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.

See also: ServerSocket.setSoTimeout()

See also: ServerSocket.getSoTimeout()

statusLogDir

 public String getStatusLogDir()
 public void setStatusLogDir(String statusLogDir)
Specify the location of log files.

Parameters:

statusLogDir
- The directory where to write log files.

tempDir

 public String getTempDir()
 public void setTempDir(String tempDir)
The temporary directory for all DataStore connections. If null, the current directory is used.

DataStoreServer methods

addServerStatusListener(listener)

  public final void addServerStatusListener(ServerStatusListener listener)

Parameters:

listener
ServerStatusListener to be notified of status changes (like connections and disconnections) and exceptions encountered by the server.

closeConnections()

  public final void closeConnections()
Close all ServerConnection instances initiated by this instance of DataStoreServer.

removeServerStatusListener(listener)

  public final void removeServerStatusListener(ServerStatusListener listener)

Parameters:

listener
ServerStatusListener to removed from the event notification list.

shutdown()

  public final void shutdown()
Causes the DataStoreServer to terminate and close all ServerConnection instances initiated by this DataStoreServer instance.

start()

  public synchronized void start()
Starts the DataStoreServer, which will accept remote connections.