Class ClifRegistry


  • public class ClifRegistry
    extends java.lang.Object
    The clifRegistry is responsible for creating the initial FractalRMI registry if not externally provided.
    Author:
    Bruno Dillenseger, Joan Chaumont
    • Constructor Summary

      Constructors 
      Constructor Description
      ClifRegistry​(boolean createRegistry)
      Creates a new test plan deployer, using the default RMI registry (as specified by system properties fractal.registry.host and fractal.registry.port)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(java.lang.String name, org.objectweb.fractal.api.Component comp)
      Direct access to CLIF/Fractal registry for binding a component to a name
      void bindClifApp​(java.lang.String name, org.objectweb.fractal.api.Component clifApp)
      Bind clifApp component in registry namingService.
      void bindServer​(java.lang.String name, org.objectweb.fractal.api.Component server)
      Bind server component in registry namingService.
      static void createRegistry​(int port)  
      java.util.Map<java.lang.String,​org.objectweb.fractal.api.Component> getServerComponents()
      Gets the list of registered CLIF server names and components
      java.lang.String[] getServers()
      Get bound servers in ClifRegistry
      java.lang.String[] list()
      Direct access to CLIF/Fractal registry for listing all bound names
      org.objectweb.fractal.api.Component lookup​(java.lang.String name)
      Direct access to CLIF/Fractal registry for finding a component from its name
      org.objectweb.fractal.api.Component lookupClifApp​(java.lang.String name)
      Looks for a clifApp component.
      org.objectweb.fractal.api.Component lookupServer​(java.lang.String name)
      Looks for a server component.
      void rebind​(java.lang.String name, org.objectweb.fractal.api.Component comp)
      Direct access to CLIF/Fractal registry for rebinding a component to a name
      java.lang.String toString()  
      void unbind​(java.lang.String name)
      Direct access to CLIF/Fractal registry for unbinding a component name
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ClifRegistry

        public ClifRegistry​(boolean createRegistry)
                     throws java.lang.Exception
        Creates a new test plan deployer, using the default RMI registry (as specified by system properties fractal.registry.host and fractal.registry.port)
        Parameters:
        createRegistry - if true, a FractalRMI registry is created on localhost using default port; if false, the registry is supposed to be running already on the default host and port.
        Throws:
        java.lang.Error
        java.lang.Exception
    • Method Detail

      • getServers

        public java.lang.String[] getServers()
        Get bound servers in ClifRegistry
        Returns:
        an array of the names of all available CLIF servers (i.e. registered in the FractalRMI Registry)
      • getServerComponents

        public java.util.Map<java.lang.String,​org.objectweb.fractal.api.Component> getServerComponents()
        Gets the list of registered CLIF server names and components
        Returns:
        a map with server names as keys and Clif server components as values
      • bindServer

        public void bindServer​(java.lang.String name,
                               org.objectweb.fractal.api.Component server)
        Bind server component in registry namingService. Replace if binding allready exists.
        Parameters:
        name - name to be associated with the server
        server - server to be associated with the given name
      • bindClifApp

        public void bindClifApp​(java.lang.String name,
                                org.objectweb.fractal.api.Component clifApp)
        Bind clifApp component in registry namingService. Replace if binding allready exists.
        Parameters:
        name - name to be associated with the clifApp
        clifApp - clifApp to be associated with the given name
      • bind

        public void bind​(java.lang.String name,
                         org.objectweb.fractal.api.Component comp)
        Direct access to CLIF/Fractal registry for binding a component to a name
        Parameters:
        name - the component name
        comp - the component
      • rebind

        public void rebind​(java.lang.String name,
                           org.objectweb.fractal.api.Component comp)
        Direct access to CLIF/Fractal registry for rebinding a component to a name
        Parameters:
        name - the component name
        comp - the component
      • unbind

        public void unbind​(java.lang.String name)
        Direct access to CLIF/Fractal registry for unbinding a component name
        Parameters:
        name - the component name
      • lookup

        public org.objectweb.fractal.api.Component lookup​(java.lang.String name)
        Direct access to CLIF/Fractal registry for finding a component from its name
        Parameters:
        name - component name
        Returns:
        the component bound to the given name
      • list

        public java.lang.String[] list()
        Direct access to CLIF/Fractal registry for listing all bound names
        Returns:
        the list of names bound to components
      • lookupServer

        public org.objectweb.fractal.api.Component lookupServer​(java.lang.String name)
        Looks for a server component.
        Parameters:
        name - the name to look for.
        Returns:
        Component if exists return server component else null
      • lookupClifApp

        public org.objectweb.fractal.api.Component lookupClifApp​(java.lang.String name)
        Looks for a clifApp component.
        Parameters:
        name - the name to look for.
        Returns:
        Component if exists return clifApp component else null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        string representation in the form registry@host:port_number
      • createRegistry

        public static void createRegistry​(int port)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception