Contents Index MessageType enumeration ServerException class

MobiLink Synchronization User's Guide
  Writing Synchronization Scripts in .NET
    MobiLink .NET API Reference

ServerContext interface


public interface ServerContext
Member of iAnywhere.MobiLink.Script

An instantiation of all the context that is present for the duration of the MobiLink server. This context can be held as static data and used in a background thread. It is valid for the duration of the .NET CLR invoked by MobiLink.

GetStartClassInstances method 

public object[ ] GetStartClassInstances( )
Member of iAnywhere.MobiLink.Script.ServerContext

Gets an array of the start classes that were constructed at server start time. The array length is zero if there are no start classes.

For more information about user-defined start classes, see User-defined start classes.

Following is an example of getStartClassInstances():

void FindStartClass( ServerContext sc, string name )
 {
   object[] startClasses = sc.GetStartClassInstances();
   foreach( object obj in startClasses ) {
     if( obj is MyClass ) {
         // Execute some code.....
     }
   }
 }
LogCallback ErrorListener event 

This event is triggered when the MobiLink synchronization server prints an error.

LogCallback WarningListener event 

This event is triggered when the MobiLink synchronization server prints a warning.

MakeConnection method 

public iAnywhere.MobiLink.Script.DBConnection makeConnection( )
Member of iAnywhere.MobiLink.Script.ServerContext

Opens and returns a new server connection. To access the server context, use DBConnectionContext.getServerContext on the synchronization context for the current connection.

ShutDown method 

public void Shutdown( )
Member of iAnywhere.MobiLink.Script.ServerContext

Forces the server to shut down.

ShutdownListener method 

public event iAnywhere.MobiLink.Script.ShutdownCallback ShutdownListener( iAnwyhere.MobiLink.Script.ServerContext sc)
Member of iAnywhere.MobiLink.Script.ServerContext

This event is triggered on shutdown. The following code is an example of how to use this event:

ShutdownCallback callback = new ShutdownCallback( shutdownHandler );
_sc.ShutdownListener += callback;
public void shutdownHandler( ServerContext sc )
//===============================================
{
_test_out_file.WriteLine( "shutdownPerformed" );
}

Contents Index MessageType enumeration ServerException class