org.dawb.tango.extensions.factory
Class TangoConnectionFactory

java.lang.Object
  extended by org.dawb.tango.extensions.factory.TangoConnectionFactory

public class TangoConnectionFactory
extends java.lang.Object

This class is designed to give: 1. a dummy connection or a tango one. 2. deal with the fact that you can only have one attribute class listening to a connection and parameter combination at a time. This allows a dummy mode to be used which is useful for testing as no spec motors will be moved by the tango service.

Author:
gerring

Constructor Summary
TangoConnectionFactory()
           
 
Method Summary
static void clear()
          Call to clear any cahed connections.
static TangoConnection openCommandConnection(java.lang.String hardwareURI)
          This connection connects to a DeviceProxy and sends commands to the "ExecuteCmd" string of the connection.
static TangoConnection openCommandConnection(java.lang.String hardwareURI, java.lang.String outputAttribute)
          This connection connects to a DeviceProxy and sends commands to the "ExecuteCmd" string of the connection.
static TangoConnection openConnection(java.lang.String hardwareURI, java.lang.String attributeName)
          Get a connection to tango, this many also be a dummy connection if the system is in dummy mode.
static fr.esrf.TangoApi.DeviceProxy openDirectConnection(java.lang.String tangoURL)
          Use this method to use the correct classloader when making a DeviceProxy or Tango will break.
static TangoConnection openMonitoredConnection(java.lang.String hardwareURI, java.lang.String attributeName)
          Get a connection to tango, this many also be a dummy connection if the system is in dummy mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TangoConnectionFactory

public TangoConnectionFactory()
Method Detail

openConnection

public static TangoConnection openConnection(java.lang.String hardwareURI,
                                             java.lang.String attributeName)
                                      throws java.lang.Exception
Get a connection to tango, this many also be a dummy connection if the system is in dummy mode. The connection attaches no listener you call still call dispose() when the connection is finished with.

Parameters:
hardwareURI -
attributeName -
Returns:
Throws:
java.lang.Exception

openMonitoredConnection

public static TangoConnection openMonitoredConnection(java.lang.String hardwareURI,
                                                      java.lang.String attributeName)
                                               throws java.lang.Exception
Get a connection to tango, this many also be a dummy connection if the system is in dummy mode. The connection attaches a listener and the dispose() method *must* be called when the connection is finished with.

Parameters:
hardwareURI -
attributeName -
Returns:
Throws:
java.lang.Exception

openCommandConnection

public static TangoConnection openCommandConnection(java.lang.String hardwareURI)
                                             throws java.lang.Exception
This connection connects to a DeviceProxy and sends commands to the "ExecuteCmd" string of the connection. It is used for Spec connections where commands are run and notified. Listens to the attribute "Output" use openCommandConnection(String,String) to listen to a different attribute.

Parameters:
hardwareURI -
Returns:
Throws:
java.lang.Exception

openCommandConnection

public static TangoConnection openCommandConnection(java.lang.String hardwareURI,
                                                    java.lang.String outputAttribute)
                                             throws java.lang.Exception
This connection connects to a DeviceProxy and sends commands to the "ExecuteCmd" string of the connection. It is used for Spec connections where commands are run and notified.

Parameters:
hardwareURI -
outputAttribute -
Returns:
Throws:
java.lang.Exception

clear

public static void clear()
Call to clear any cahed connections.


openDirectConnection

public static fr.esrf.TangoApi.DeviceProxy openDirectConnection(java.lang.String tangoURL)
                                                         throws java.lang.Exception
Use this method to use the correct classloader when making a DeviceProxy or Tango will break. Do not use new DeviceProxy(...) outside this plugin or else the Corba classloading will be broken.

Parameters:
tangoURL -
Returns:
Throws:
java.lang.Exception