|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfabric.worker.Worker
public final class Worker
This is the main interface to the Fabric API. Applications wishing to use
Fabric must first initialize it by calling one of the initialize
methods, and can then use the singleton Worker instance to access Stores and
Objects.
Nested Class Summary | |
---|---|
static interface |
Worker.Code<T>
|
Field Summary | |
---|---|
protected FetchManager |
fetchManager
|
protected static Worker |
instance
The singleton Worker instance. |
java.security.Principal |
javaPrincipal
|
protected java.security.KeyStore |
keyStore
|
protected LocalStore |
localStore
|
java.lang.String |
name
|
int |
port
|
protected NodePrincipal |
principal
|
static java.util.Random |
RAND
|
int |
retries
|
javax.net.ssl.SSLSocketFactory |
sslSocketFactory
|
NameService |
storeNameService
|
protected java.util.Map<java.lang.String,RemoteStore> |
stores
|
int |
timeout
|
NameService |
workerNameService
|
Method Summary | ||
---|---|---|
void |
clearCache()
Clears out the worker cache (but leaves dissemination cache intact). |
|
FetchManager |
fetchManager()
Returns the fetch manager. |
|
java.security.Principal |
getJavaPrincipal()
|
|
LocalStore |
getLocalStore()
|
|
RemoteWorker |
getLocalWorker()
|
|
NodePrincipal |
getPrincipal()
|
|
RemoteStore |
getStore(java.lang.String name)
Returns a Store object representing the given store. |
|
static Worker |
getWorker()
Returns the Singleton Worker instance. |
|
RemoteWorker |
getWorker(java.lang.String name)
|
|
static void |
initialize(java.lang.String name)
|
|
static void |
initialize(java.lang.String name,
java.lang.String principalURL,
java.util.Map<java.lang.String,RemoteStore> initStoreSet)
|
|
static void |
main(java.lang.String[] args)
|
|
void |
registerDisseminationCache(Cache cache)
Registers that a worker has a new dissemination cache. |
|
static
|
runInSubTransaction(Worker.Code<T> code)
Executes the given code from within a Fabric subtransaction of the current transaction. |
|
static
|
runInTransaction(TransactionID tid,
Worker.Code<T> code)
Executes the given code from within a Fabric transaction. |
|
static
|
runInTransactionUnauthenticated(Worker.Code<T> code)
Executes the given code from within a top-level Fabric transaction. |
|
void |
setStore(java.lang.String name,
RemoteStore store)
|
|
void |
shutdown()
Called to shut down and clean up worker. |
|
boolean |
updateCache(RemoteStore store,
ObjectGroup group)
Updates the worker cache with the given object group. |
|
boolean |
updateDissemCaches(RemoteStore store,
long onum,
Glob update)
Updates the dissemination caches with the given object glob. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String name
public final int port
protected final java.util.Map<java.lang.String,RemoteStore> stores
protected final LocalStore localStore
protected final java.security.KeyStore keyStore
public final javax.net.ssl.SSLSocketFactory sslSocketFactory
protected final NodePrincipal principal
public final java.security.Principal javaPrincipal
public final int timeout
public final int retries
public final NameService storeNameService
public final NameService workerNameService
protected final FetchManager fetchManager
public static final java.util.Random RAND
protected static Worker instance
Method Detail |
---|
public static Worker getWorker() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the Fabric worker is uninitializedpublic RemoteStore getStore(java.lang.String name)
Store
object representing the given store.
name
- The store's host name.
Store
object.public RemoteWorker getWorker(java.lang.String name)
RemoteWorker
objectpublic LocalStore getLocalStore()
public RemoteWorker getLocalWorker()
public FetchManager fetchManager()
public void registerDisseminationCache(Cache cache)
public boolean updateDissemCaches(RemoteStore store, long onum, Glob update)
public boolean updateCache(RemoteStore store, ObjectGroup group)
public NodePrincipal getPrincipal()
public java.security.Principal getJavaPrincipal()
public void clearCache()
public void shutdown()
public static void initialize(java.lang.String name) throws java.security.UnrecoverableKeyException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.lang.IllegalStateException, java.io.IOException, InternalError, UsageError
java.security.UnrecoverableKeyException
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.lang.IllegalStateException
java.io.IOException
InternalError
UsageError
public static void initialize(java.lang.String name, java.lang.String principalURL, java.util.Map<java.lang.String,RemoteStore> initStoreSet) throws java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.UnrecoverableKeyException, java.lang.IllegalStateException, InternalError, UsageError
java.io.IOException
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.UnrecoverableKeyException
java.lang.IllegalStateException
InternalError
UsageError
public static void main(java.lang.String[] args) throws java.lang.Throwable
java.lang.Throwable
public void setStore(java.lang.String name, RemoteStore store)
public static <T> T runInTransaction(TransactionID tid, Worker.Code<T> code)
tid
- The parent transaction for the subtransaction that will be
created.public static <T> T runInTransactionUnauthenticated(Worker.Code<T> code)
public static <T> T runInSubTransaction(Worker.Code<T> code)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |