com.tencent.tcaplus.client
Class ClientFactory

java.lang.Object
  extended by com.tencent.tcaplus.client.ClientFactory

public abstract class ClientFactory
extends java.lang.Object

Tcaplus ClientFactory.

Version:
Version 1.0
Author:
yahuiwang,elviszhu

Constructor Summary
ClientFactory()
           
 
Method Summary
static Client createClient(int appId, int zoneId, java.lang.String signature, java.util.List<java.lang.String> addresses)
          Create a tcaplus client
static void destroyClient(Client client)
          Destroy the tcaplus client when you quit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientFactory

public ClientFactory()
Method Detail

createClient

public static Client createClient(int appId,
                                  int zoneId,
                                  java.lang.String signature,
                                  java.util.List<java.lang.String> addresses)
                           throws com.tencent.tcaplus.util.TCaplusException
Create a tcaplus client

Parameters:
int - appId: the application id you get after you have registered a tcaplus service.
int - zoneId: the zone id you distribute your application
String - signature: you will get a string signature after you have registered a tcaplus service.
List - addresses: dir server address list
Throws:
com.tencent.tcaplus.util.TCaplusException
java.lang.IllegalStateException

destroyClient

public static void destroyClient(Client client)
                          throws com.tencent.tcaplus.util.TCaplusException
Destroy the tcaplus client when you quit. After called, the daemon threads will relaese the resources and exit.

Throws:
com.tencent.tcaplus.util.TCaplusException