org.deegree.commons.config
Class ResourceState<T extends Resource>

java.lang.Object
  extended by org.deegree.commons.config.ResourceState<T>

public class ResourceState<T extends Resource>
extends Object

Encapsulates information on the state of a managed Resource (and provides access to it).

Version:
$Revision: 30337 $, $Date: 2011-04-04 14:21:18 +0200 (Mon, 04 Apr 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Nested Class Summary
static class ResourceState.StateType
          Represents the lifecycle phases of a Resource.
 
Constructor Summary
ResourceState(String id, File configLocation, ResourceProvider provider, ResourceState.StateType type, T resource, ResourceInitException lastException)
          Creates a new ResourceState instance.
 
Method Summary
 File getConfigLocation()
           
 String getId()
          Returns an identifier that uniquely identifies the resource among all resources that are managed by the corresponding ResourceManager.
 ResourceInitException getLastException()
          Returns the exception that occurred during the last state change of the resource.
 ResourceProvider getProvider()
          Returns the ResourceProvider responsible for this resource.
 T getResource()
          Returns the actual resource.
 ResourceState.StateType getType()
          Returns the state type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceState

public ResourceState(String id,
                     File configLocation,
                     ResourceProvider provider,
                     ResourceState.StateType type,
                     T resource,
                     ResourceInitException lastException)
Creates a new ResourceState instance.

Parameters:
id - resource identifier, never null
configLocation - config file location, can be null
type - state type, must not be null
resource - actual resource object, can be null
lastException - exception that occurred during the last state change of the resource, can be null (no exception)
Method Detail

getId

public String getId()
Returns an identifier that uniquely identifies the resource among all resources that are managed by the corresponding ResourceManager.

Returns:
identifier of the resource, never null

getConfigLocation

public File getConfigLocation()

getProvider

public ResourceProvider getProvider()
Returns the ResourceProvider responsible for this resource.

Returns:
resource provider, can be null (no suitable resource provider available)

getType

public ResourceState.StateType getType()
Returns the state type.

Returns:
the state type, never null

getResource

public T getResource()
Returns the actual resource.

Returns:
resource, can be null

getLastException

public ResourceInitException getLastException()
Returns the exception that occurred during the last state change of the resource.

Returns:
the last exception, can be null


Copyright © 2011. All Rights Reserved.