org.apache.felix.ipojo.manipulator
Interface ResourceStore

All Known Implementing Classes:
DirectoryResourceStore, JarFileResourceStore

public interface ResourceStore

Abstract input/output for the manipulation process.

Author:
Felix Project Team

Method Summary
 void accept(ResourceVisitor visitor)
          Browse all resources available in this store.
 void close()
          Close the store: no methods will be called anymore on this instance.
 void open()
          Notify the store that resource will be written.
 byte[] read(java.lang.String path)
          Return the bytecode of the given class name.
 void write(java.lang.String resourcePath, byte[] resource)
          Notify the builder that a new resource has been built and should be stored in the resulting bundle.
 void writeMetadata(org.apache.felix.ipojo.metadata.Element metadata)
          Writes the given Element into this store.
 

Method Detail

read

byte[] read(java.lang.String path)
            throws java.io.IOException
Return the bytecode of the given class name.

Parameters:
path - normalized resource path (format: org/objectweb/asm/Visitor.class)
Returns:
the byte array representing the given class
Throws:
java.io.IOException - if resource was not found

accept

void accept(ResourceVisitor visitor)
Browse all resources available in this store.

Parameters:
visitor - is called for each available resource

open

void open()
          throws java.io.IOException
Notify the store that resource will be written.

Throws:
java.io.IOException - if there was an error

writeMetadata

void writeMetadata(org.apache.felix.ipojo.metadata.Element metadata)
Writes the given Element into this store. Typically a store implementation will use this to build a Manifest.

Parameters:
metadata - Element metadata to be inserted

write

void write(java.lang.String resourcePath,
           byte[] resource)
           throws java.io.IOException
Notify the builder that a new resource has been built and should be stored in the resulting bundle.

Parameters:
resourcePath - resource name of the class (format: org/objectweb/asm/Visitor.class)
resource - content of the resource
Throws:
java.io.IOException - if there was an error storing the resource

close

void close()
           throws java.io.IOException
Close the store: no methods will be called anymore on this instance.

Throws:
java.io.IOException - if close failed


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.