p2pcm
Class ComponentUtil

java.lang.Object
  extended by p2pcm.ComponentUtil

public class ComponentUtil
extends java.lang.Object

This class provides static methods for deploying / undeploying components in the network

Version:
1.2
Author:
Rubén Mondéjar , Carles Pairot

Constructor Summary
ComponentUtil()
           
 
Method Summary
static ComponentInterface createInnerObject(java.lang.String implClass, java.lang.String instance, java.lang.Object... params)
          Factory method used for creating an inner object within a component Useful for components which may delegate some view implementations to other classes / objects
static void deployComponent(java.net.URL componentResource)
          Method for deploying a component on the structured peer-to-peer overlay network
static ComponentFactory getComponentFactory(java.lang.String componentLocation)
          Method for getting any component's factory instance
static void unDeployComponent(java.lang.String componentID)
          Method for undeploying a Dermi component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentUtil

public ComponentUtil()
Method Detail

deployComponent

public static void deployComponent(java.net.URL componentResource)
                            throws ComponentDeploymentException,
                                   dermi.exception.ComponentMetadataIncompleteException
Method for deploying a component on the structured peer-to-peer overlay network

Parameters:
componentResource - URL Component's URL
Throws:
java.lang.Exception
ComponentDeploymentException
dermi.exception.ComponentMetadataIncompleteException

unDeployComponent

public static void unDeployComponent(java.lang.String componentID)
                              throws ComponentDeploymentException
Method for undeploying a Dermi component

Parameters:
componentID - String Component's identifier
Throws:
ComponentDeploymentException - If component cannot be unregistered correctly

getComponentFactory

public static ComponentFactory getComponentFactory(java.lang.String componentLocation)
                                            throws ComponentNotRegisteredException,
                                                   ComponentInitializationException
Method for getting any component's factory instance

Parameters:
componentLocation - String URL-like component locator
Returns:
ComponentFactory The component's factory class
Throws:
ComponentNotRegisteredException - Thrown if the component was not previously deployed on the overlay network
ComponentInitializationException - Thrown if it is impossible to initialize the component's factory

createInnerObject

public static ComponentInterface createInnerObject(java.lang.String implClass,
                                                   java.lang.String instance,
                                                   java.lang.Object... params)
                                            throws ComponentInitializationException
Factory method used for creating an inner object within a component Useful for components which may delegate some view implementations to other classes / objects

Parameters:
implClass - String Implementation class name
instance - String Instance name
params - Object[] Object creation arguments
Returns:
ComponentInterface A component's interface implementation
Throws:
ComponentInitializationException - If component (inner object) cannot be initialized