Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.drools.io
Interface ResourceChangeNotifier

    public interface ResourceChangeNotifier

ResourceChangeListeners can subscribe to the notifier to receive ChangeSet info when results they are subscribed to change. The ResourceChangeNotifier itself is not monitoring resources for changes, instead it delegates to added ResourceChangeMonitor implementations. When a ResourceChangeListener subscribes to a Resource that subscription is delegated to the added monitors.

This interface, as well as ChangeSet, ResourceChangeMonitor, esourceChangeListener and ResourceChangeScanner are still considered subject to change. Use the XML format change-set, as part of the ResourceType api when adding to KnowledgeBuilder, which is considered stable. KnowledgeBuilder currently ignored Added/Modified xml elements, the KnowledgeAgent will use them, when rebuilding the KnowledgeBase.

Method Summary
`void` | `addResourceChangeMonitor(ResourceChangeMonitor monitor)` Add a ResourceChangeMonitor, which will receive all Resource subscriptions.
`Collection<ResourceChangeMonitor>` | `getResourceChangeMonitors()` Return a collection of the added ResourceChangeMonitors
`void` | `publishChangeSet(ChangeSet changeSet)` Called by the added ResourceChangeMonitors to inform this ResourceChangeNotifier of resource changes.
`void` | `removeResourceChangeMonitor(ResourceChangeMonitor monitor)` Remove a ResourceChangeMonitor.
`void` | `setSystemEventListener(SystemEventListener listener)`
`void` | `start()` Start the service, this will create a new Thread.
`void` | `stop()` Stop the service.
`void` | `subscribeChildResource(Resource directory, Resource child)` When a ResourceChangeMonitor is asked to monitor a directory, it needs a way to tell the ResourceChangeNotifier of any newly added Resources.
`void` | `subscribeResourceChangeListener(ResourceChangeListener listener, Resource resource)`
`void` | `unsubscribeResourceChangeListener(ResourceChangeListener listener, Resource resource)`

Method Detail

### subscribeResourceChangeListener

    void subscribeResourceChangeListener(ResourceChangeListener listener,
                                         Resource resource)

### unsubscribeResourceChangeListener

    void unsubscribeResourceChangeListener(ResourceChangeListener listener,
                                           Resource resource)

### subscribeChildResource

    void subscribeChildResource(Resource directory,
                                Resource child)

  When a ResourceChangeMonitor is asked to monitor a directory, it needs a way to tell the ResourceChangeNotifier of any newly added Resources.

  Parameters:
    `directory` - The parent directory the discovered child is in.
    `child` - The discovered child resource

### addResourceChangeMonitor

    void addResourceChangeMonitor(ResourceChangeMonitor monitor)

  Add a ResourceChangeMonitor, which will receive all Resource subscriptions.

  Parameters:
    `monitor` -

### removeResourceChangeMonitor

    void removeResourceChangeMonitor(ResourceChangeMonitor monitor)

  Remove a ResourceChangeMonitor.

  Parameters:
    `monitor` -

### getResourceChangeMonitors

    Collection<ResourceChangeMonitor> getResourceChangeMonitors()

  Return a collection of the added ResourceChangeMonitors

  Returns:

### publishChangeSet

    void publishChangeSet(ChangeSet changeSet)

  Called by the added ResourceChangeMonitors to inform this ResourceChangeNotifier of resource changes. The ResourceChangeMontior must have a reference to the ResourceChangeNotifiers they are added to,

  Parameters:
    `changeSet` -

### setSystemEventListener

    void setSystemEventListener(SystemEventListener listener)

### start

    void start()

  Start the service, this will create a new Thread.

### stop

    void stop()

  Stop the service.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.