Package org.eclipse.ecf.core.sharedobject

Examples of org.eclipse.ecf.core.sharedobject.SharedObjectInitException


  public void init(ISharedObjectConfig initData)
      throws SharedObjectInitException {
    if (config == null) {
      config = initData;
    } else {
      throw new SharedObjectInitException("Already initialized.");
    }
    trace("init(" + initData + ")");
    // get local publish path
    publishPathName = (String) initData.getProperties().get(
        PUBLISH_PROPERTY_NAME);
    publishPathName = publishPathName == null ? "feed.xml"
        : publishPathName;
    // get local channel container first...throw if we can't get it
    IMergeableChannelContainerAdapter container = (IMergeableChannelContainerAdapter) config
        .getContext().getAdapter(
            IMergeableChannelContainerAdapter.class);
    if (container == null) {
      throw new SharedObjectInitException(
          "Channel container is null/not available");
    }
    if (container instanceof RssClientSOContainer) {
      // get rss feed
      try {
        feed = ((RssClientSOContainer) container).receiveFeed(getID()
            .getName());
      } catch (IOException ioe) {
        throw new SharedObjectInitException(ioe);
      }
    }
  }
View Full Code Here


    Map props = config.getProperties();
   
    if (config.getContext().getLocalContainerID().equals(config.getHomeContainerID())) {
      containerID = (ID) props.get(CONTAINER_ID_KEY);
      if (containerID == null)
        throw new SharedObjectInitException("containerID is required");

      callback = (ISubscriptionCallback) props.get(CALLBACK_KEY);
      if (callback == null)
        throw new SharedObjectInitException("callback is required");
    }
   
    sharedObjectID = (ID) props.get(SHARED_OBJECT_ID_KEY);
    if (sharedObjectID == null)
      throw new SharedObjectInitException("sharedObjectID is required");

    this.config = config;
  }
View Full Code Here

    public synchronized void init(ISharedObjectConfig initData)
            throws SharedObjectInitException {
        if (config == null)
            config = initData;
        else
            throw new SharedObjectInitException("Already initialized.");

        if (version == null)
            version = new Version(config.getSharedObjectID());

        if (dataGraph != null)
View Full Code Here

            throws SharedObjectInitException {

        if (config == null)
            config = initData;
        else
            throw new SharedObjectInitException("Already initialized.");
    }
View Full Code Here

 
  protected void initializeData(Object data) throws SharedObjectInitException {
    try {
      this.data = SerializationUtil.deserialize((byte[]) data);
    } catch (IOException e) {
      throw new SharedObjectInitException(e);
    } catch (ClassNotFoundException e) {
      throw new SharedObjectInitException(e);
    }
  }
View Full Code Here

  }
 
  protected void initializeUpdater() throws SharedObjectInitException {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    if (registry == null)
      throw new SharedObjectInitException("No Platform Extension Registry.");
   
    IConfigurationElement[] elements = registry.getConfigurationElementsFor("org.eclipse.ecf.example.pubsub.modelUpdater");
    for (int i = 0; i < elements.length; ++i) {
      if (updaterID.equals(elements[i].getAttribute("id"))) {
        try {
          updater = (IModelUpdater) elements[i].createExecutableExtension("class");
        } catch (CoreException e) {
          throw new SharedObjectInitException(e);
        } catch (ClassCastException e) {
          throw new SharedObjectInitException(e);
        }

        break;
      }
    }

    if (updater == null)
      throw new SharedObjectInitException("Could not find specified Model Updater.");
  }
View Full Code Here

  public void init(ISharedObjectConfig config) throws SharedObjectInitException {
    Map props = config.getProperties();
    initializeData(props.get(INITIAL_DATA_KEY));
    updaterID = (String) props.get(MODEL_UPDATER_KEY);
    if (updaterID == null)
      throw new SharedObjectInitException("Model Updater is required.");
   
    initializeUpdater();
    this.config = config;
  }
View Full Code Here

  public void init(ISharedObjectConfig config) throws SharedObjectInitException {
    if (config.getContext().getLocalContainerID().equals(config.getHomeContainerID())) {
      directory = (PublishedServiceDirectory) config.getProperties().get(DIRECTORY_KEY);
      if (directory == null)
        throw new SharedObjectInitException("Directory is required.");
    }
   
    this.config = config;
  }
View Full Code Here

  public synchronized void init(ISharedObjectConfig initData)
      throws SharedObjectInitException {
    if (config == null)
      config = initData;
    else
      throw new SharedObjectInitException("Already initialized.");

    Map props = (Map) config.getProperties();
    if (props != null) {
      Object memento = props.get(ARG_TABLE);
      if (memento != null)
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.core.sharedobject.SharedObjectInitException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.