MetaDone
metadone.client.grasyla2.actions.LoadResourceEvent< T > Class Reference
Inheritance diagram for metadone.client.grasyla2.actions.LoadResourceEvent< T >:
Collaboration diagram for metadone.client.grasyla2.actions.LoadResourceEvent< T >:

List of all members.

Public Member Functions

 LoadResourceEvent (Engine engine, Class< T > type, String resourceName)
final String getSource ()
final Class< T > getType ()
getResource ()
void setResource (T resource)
loadResource ()
byte[] loadBytes () throws IOException

Protected Member Functions

final byte[] loadResource (InputStream in) throws IOException

Private Attributes

final String resourceName
final Class< T > type
resource

Static Private Attributes

static final Map< URL, byte[]> URL_CACHE = Collections.synchronizedMap(new WeakHashMap<URL, byte[]>())

Detailed Description

An event indicating a request to load a resource.

Author:
kma
Parameters:
<T>The type of the resource

Constructor & Destructor Documentation

metadone.client.grasyla2.actions.LoadResourceEvent< T >.LoadResourceEvent ( Engine  engine,
Class< T >  type,
String  resourceName 
)

Initializes this event.

Parameters:
engineThe engine
typeThe class
resourceNameThe name of the resource or its URL

Member Function Documentation

T metadone.client.grasyla2.actions.LoadResourceEvent< T >.getResource ( )

Gets the set resource.

Returns:
The resource
final String metadone.client.grasyla2.actions.LoadResourceEvent< T >.getSource ( )
final Class<T> metadone.client.grasyla2.actions.LoadResourceEvent< T >.getType ( )

Gets the type.

Returns:
The class
byte [] metadone.client.grasyla2.actions.LoadResourceEvent< T >.loadBytes ( ) throws IOException

Loads an array of bytes from the file represented by the resource name.

Returns:
The array of bytes
Exceptions:
IOExceptionwhen the resource couldn't be found
final byte [] metadone.client.grasyla2.actions.LoadResourceEvent< T >.loadResource ( InputStream  in) throws IOException [protected]

Loads a resource from the input stream.

Parameters:
inThe input stream or null
Returns:
The array of bytes
Exceptions:
IOExceptionwhen an IO exception occurred
T metadone.client.grasyla2.actions.LoadResourceEvent< T >.loadResource ( )

Loads a resource.

This method tries to load the resource, it can also return an already set resource.

Returns:
See also:
getResource()
void metadone.client.grasyla2.actions.LoadResourceEvent< T >.setResource ( resource)

Sets the resource.

Parameters:
resourceThe new resource

Member Data Documentation

T metadone.client.grasyla2.actions.LoadResourceEvent< T >.resource [private]
final String metadone.client.grasyla2.actions.LoadResourceEvent< T >.resourceName [private]
final Class<T> metadone.client.grasyla2.actions.LoadResourceEvent< T >.type [private]
final Map<URL, byte[]> metadone.client.grasyla2.actions.LoadResourceEvent< T >.URL_CACHE = Collections.synchronizedMap(new WeakHashMap<URL, byte[]>()) [static, private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations