Eclipse Platform
2.0

org.eclipse.update.core
Interface IFeatureContentConsumer


public interface IFeatureContentConsumer

Feature content consumer. A feature content consumer is an abstraction of each feature internal packaging mechanism. It allows content to be stored into a feature in a standard way regardless of the packaging mechanism used. Only concrete features that support storing need to implement a content consumer. The platform implements at least one feature type supporting content consumer. This is the feature type representing a locally-installed feature.

A feature content consumer delegates the storage of plug-in and non-plug-in files to a generic content consumer.

Clients may implement this interface. However, in most cases clients will only use the feature content consumer provided by the feature type(s) implemented by the platform.

Since:
2.0
See Also:
IContentConsumer

Method Summary
 void abort()
          Closes this content consumer, indicating the store operations should be aborted.
 void addChild(IFeature feature)
          Link the content consumer of the feature as a child content consumer
 IFeatureReference close()
          Closes this content consumer.
 IFeatureContentConsumer[] getChildren()
          Returns the feature content consumers that this feature content consumer opened
 IFeature getFeature()
          Returns the feature for this content consumer.
 IFeatureContentConsumer getParent()
          Returns the feature content consumer that opened this feature content consumer, or null if this feature content consumer is a root feature content consumer.
 IContentConsumer open(INonPluginEntry nonPluginEntry)
          Opens a generic content consumer for the specified non-plug-in entry.
 IContentConsumer open(IPluginEntry pluginEntry)
          Opens a generic content consumer for the specified plug-in entry.
 void setFeature(IFeature feature)
          Sets the feature for this content consumer.
 void setParent(IFeatureContentConsumer parent)
          Sets the parent for this content consumer.
 void store(ContentReference contentReference, IProgressMonitor monitor)
          Store a feature file.
 

Method Detail

store

public void store(ContentReference contentReference,
                  IProgressMonitor monitor)
           throws CoreException
Store a feature file. Note that only the feature definition files should be stored using this method. Plug-in files and non-plug-in data files should be stored using the content consumers corresponding to their respective entries.

Throws:
CoreException
Since:
2.0
See Also:
open(IPluginEntry), open(INonPluginEntry)

open

public IContentConsumer open(IPluginEntry pluginEntry)
                      throws CoreException
Opens a generic content consumer for the specified plug-in entry. Plug-in files corresponding to this entry should be stored using this content consumer.

Returns:
generic content consumer for the entry
Throws:
CoreException
Since:
2.0

open

public IContentConsumer open(INonPluginEntry nonPluginEntry)
                      throws CoreException
Opens a generic content consumer for the specified non-plug-in entry. Non-plug-in files corresponding to this entry should be stored using this content consumer.

Parameters:
nonPluginEntry - non-plug-in entry
Returns:
generic content consumer for the entry
Throws:
CoreException
Since:
2.0

close

public IFeatureReference close()
                        throws CoreException
Closes this content consumer. This indicates a successful completion of the store operations. The content consumer commits any changes made by this consumer.

Returns:
reference to the newly populated feature
Throws:
CoreException
Since:
2.0

abort

public void abort()
           throws CoreException
Closes this content consumer, indicating the store operations should be aborted. The content consumer attempts to back out any changes made by this content consumer.

Throws:
CoreException
Since:
2.0

setFeature

public void setFeature(IFeature feature)
Sets the feature for this content consumer. In general, this method should only be called as part of feature creation. Once set, the feature should not be reset.

Parameters:
feature - feature for this content consumer
Since:
2.0

getFeature

public IFeature getFeature()
Returns the feature for this content consumer.

Returns:
the feature for this content consumer
Since:
2.0

setParent

public void setParent(IFeatureContentConsumer parent)
Sets the parent for this content consumer. In general, this method should only be called as part of feature creation. Once set, the feature should not be reset.

Parameters:
parent - parent feature content consumer.
Since:
2.0

getParent

public IFeatureContentConsumer getParent()
Returns the feature content consumer that opened this feature content consumer, or null if this feature content consumer is a root feature content consumer.

Returns:
the parent feature content consumer, or null.
Since:
2.0

addChild

public void addChild(IFeature feature)
              throws CoreException
Link the content consumer of the feature as a child content consumer

Parameters:
feature - the child feature.
Throws:
CoreException
Since:
2.0

getChildren

public IFeatureContentConsumer[] getChildren()
Returns the feature content consumers that this feature content consumer opened

Returns:
an array of feature content consumer, or en empty array.
Since:
2.0

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.