public class Grid extends Object implements TokenRegistry, GridFileService
| Modifier and Type | Field and Description |
|---|---|
static String |
LOCAL_AGENT |
| Constructor and Description |
|---|
Grid(Integer port) |
Grid(Integer port,
Integer ttl) |
| Modifier and Type | Method and Description |
|---|---|
Collection<AgentRef> |
getAgents() |
File |
getRegisteredFile(String fileHandle)
Get a file that has been previously registered to the GRID
|
int |
getServerPort() |
List<Token<TokenWrapper>> |
getTokens() |
protected void |
handleRegistrationMessage(RegistrationMessage message) |
void |
markTokenAsFailing(String tokenId,
String errorMessage,
Exception e) |
String |
registerFile(File file)
Register a file into the GRID
|
void |
removeTokenError(String tokenId) |
void |
returnToken(TokenWrapper object) |
TokenWrapper |
selectToken(Identity pretender,
long matchTimeout,
long noMatchTimeout) |
void |
start() |
void |
startTokenMaintenance(String tokenId) |
void |
stop() |
void |
stopTokenMaintenance(String tokenId) |
public static final String LOCAL_AGENT
protected void handleRegistrationMessage(RegistrationMessage message)
public TokenWrapper selectToken(Identity pretender, long matchTimeout, long noMatchTimeout) throws TimeoutException, InterruptedException
selectToken in interface TokenRegistryTimeoutExceptionInterruptedExceptionpublic void returnToken(TokenWrapper object)
returnToken in interface TokenRegistrypublic void markTokenAsFailing(String tokenId, String errorMessage, Exception e)
markTokenAsFailing in interface TokenRegistrypublic void removeTokenError(String tokenId)
public void startTokenMaintenance(String tokenId)
public void stopTokenMaintenance(String tokenId)
public String registerFile(File file)
GridFileServiceregisterFile in interface GridFileServicefile - the file to be registered to the GRIDpublic File getRegisteredFile(String fileHandle)
GridFileServicegetRegisteredFile in interface GridFileServicefileHandle - the handle returned at regitrationpublic List<Token<TokenWrapper>> getTokens()
getTokens in interface TokenRegistrypublic Collection<AgentRef> getAgents()
public int getServerPort()
Copyright © 2018. All rights reserved.