com.cosylab.epics.caj.cas.util
Class DefaultServerImpl

java.lang.Object
  extended by com.cosylab.epics.caj.cas.util.DefaultServerImpl
All Implemented Interfaces:
gov.aps.jca.cas.Server

public class DefaultServerImpl
extends Object
implements gov.aps.jca.cas.Server

Default server implementation. Implementation keeps a hash-map of all registered PVs. When processVariableExistanceTest is called existance test is made on the hash-map. processVariableAttach metod simply retrieves PV from the hash-map.


Field Summary
protected  Map pvs
          Map of PVs.
 
Constructor Summary
DefaultServerImpl()
           
 
Method Summary
 MemoryProcessVariable createMemoryProcessVariable(String name, gov.aps.jca.dbr.DBRType type, Object initialValue)
          Convenience method to create and register new in-memory process variables.
 gov.aps.jca.cas.ProcessVariable processVariableAttach(String aliasName, gov.aps.jca.cas.ProcessVariableEventCallback eventCallback, gov.aps.jca.cas.ProcessVariableAttachCallback asyncCompletionCallback)
           
 gov.aps.jca.cas.ProcessVariableExistanceCompletion processVariableExistanceTest(String aliasName, InetSocketAddress clientAddress, gov.aps.jca.cas.ProcessVariableExistanceCallback asyncCompletionCallback)
           
 void registerProcessVaribale(gov.aps.jca.cas.ProcessVariable pv)
          Register process variable.
 void registerProcessVaribale(String aliasName, gov.aps.jca.cas.ProcessVariable pv)
          Register process variable.
 gov.aps.jca.cas.ProcessVariable unregisterProcessVaribale(String aliasName)
          Unregister process variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pvs

protected Map pvs
Map of PVs.

Constructor Detail

DefaultServerImpl

public DefaultServerImpl()
Method Detail

createMemoryProcessVariable

public MemoryProcessVariable createMemoryProcessVariable(String name,
                                                         gov.aps.jca.dbr.DBRType type,
                                                         Object initialValue)
Convenience method to create and register new in-memory process variables.

Parameters:
name - process variable name.
type - process variable native type.
initialValue - process variable initial value (array expected).
Returns:
created and registered process variable.

registerProcessVaribale

public void registerProcessVaribale(String aliasName,
                                    gov.aps.jca.cas.ProcessVariable pv)
Register process variable. Note: if process variable with aliasName is already registered this will override it.

Parameters:
aliasName - process variable name.
pv - process variable instance.

registerProcessVaribale

public void registerProcessVaribale(gov.aps.jca.cas.ProcessVariable pv)
Register process variable. Note: if process variable with the same name is already registered this will override it.

Parameters:
pv - process variable instance.

unregisterProcessVaribale

public gov.aps.jca.cas.ProcessVariable unregisterProcessVaribale(String aliasName)
Unregister process variable.

Parameters:
aliasName - process variable name
Returns:
unregistered process variable, null if non unregistered.

processVariableAttach

public gov.aps.jca.cas.ProcessVariable processVariableAttach(String aliasName,
                                                             gov.aps.jca.cas.ProcessVariableEventCallback eventCallback,
                                                             gov.aps.jca.cas.ProcessVariableAttachCallback asyncCompletionCallback)
                                                      throws gov.aps.jca.CAStatusException,
                                                             IllegalArgumentException,
                                                             IllegalStateException
Specified by:
processVariableAttach in interface gov.aps.jca.cas.Server
Throws:
gov.aps.jca.CAStatusException
IllegalArgumentException
IllegalStateException
See Also:
Server.processVariableAttach(java.lang.String, gov.aps.jca.cas.ProcessVariableEventCallback, gov.aps.jca.cas.ProcessVariableAttachCallback)

processVariableExistanceTest

public gov.aps.jca.cas.ProcessVariableExistanceCompletion processVariableExistanceTest(String aliasName,
                                                                                       InetSocketAddress clientAddress,
                                                                                       gov.aps.jca.cas.ProcessVariableExistanceCallback asyncCompletionCallback)
                                                                                throws gov.aps.jca.CAException,
                                                                                       IllegalArgumentException,
                                                                                       IllegalStateException
Specified by:
processVariableExistanceTest in interface gov.aps.jca.cas.Server
Throws:
gov.aps.jca.CAException
IllegalArgumentException
IllegalStateException
See Also:
Server.processVariableExistanceTest(java.lang.String, java.net.InetSocketAddress, gov.aps.jca.cas.ProcessVariableExistanceCallback)


Copyright © 2004-2013 Cosylab. All Rights Reserved.