ArcGIS Server Geoportal extension
10

com.esri.gpt.catalog.arcims
Class SocketFarm

java.lang.Object
  extended by com.esri.gpt.catalog.arcims.SocketFarm

public class SocketFarm
extends Object

Maintains a collection of socket queues for ArcIMS metadata server communication.


Constructor Summary
protected SocketFarm()
          Default constructor.
 
Method Summary
 void addQueue(String host, int port, int tokenSize, long waitSeconds, long sleepMillis, long orphanSeconds, String windowsServiceName)
          Adds a queue of tokens to the collection.
 boolean getHasQueues()
          Determine if the farm has queues.
 SocketToken getToken()
          Gets the next available free token.
 void lock()
          Locks the configured queue collection.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketFarm

protected SocketFarm()
Default constructor.

Method Detail

getHasQueues

public boolean getHasQueues()
Determine if the farm has queues.

Returns:
true if queues have been configured

addQueue

public void addQueue(String host,
                     int port,
                     int tokenSize,
                     long waitSeconds,
                     long sleepMillis,
                     long orphanSeconds,
                     String windowsServiceName)
Adds a queue of tokens to the collection.

Parameters:
host - the host name
port - the port
tokenSize - the number of tokens to create
waitSeconds - the number of seconds to wait for a token
sleepMillis - the number of milliseconds to sleep while waiting for a token
orphanSeconds - the number of seconds at which a token in use will be considered orphaned
windowsServiceName - windows service name for running Headless Nik

getToken

public SocketToken getToken()
                     throws SocketWaitException,
                            InterruptedException
Gets the next available free token.

Returns:
the next available token
Throws:
SocketWaitException - if too long was spent waiting for a token
InterruptedException - if the thread was interrupted while in sleep mode

lock

public void lock()
Locks the configured queue collection.


toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string

ArcGIS Server Geoportal extension
10

Copyright 2010 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.