Package org.apache.wookie.beans

Examples of org.apache.wookie.beans.SharedContext


    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2");
    if(ContextListener.useSharedDataInstanceQueues){// 
      QueueManager.getInstance().queueSetSharedDataRequest(id_key, SharedDataHelper.getInternalSharedDataKey(widgetInstance), key, value, false);
    }
    else{
      new SharedContext(widgetInstance).updateSharedData(key, value, false);
    }
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
  }
View Full Code Here


    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2");
    if(ContextListener.useSharedDataInstanceQueues){//
      QueueManager.getInstance().queueSetSharedDataRequest(id_key, SharedDataHelper.getInternalSharedDataKey(widgetInstance), key, value, true);
    }
    else{
      new SharedContext(widgetInstance).updateSharedData(key, value, true);
    }
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
  }
View Full Code Here

       
        //
        // Get the participant created in the previous transaction by widget instance
        //
      
        IParticipant [] participants =  new SharedContext(widgetInstance0).getParticipants();
        assertNotNull(participants);
        assertEquals(1, participants.length);
       
        //
        // Get the participant created in the previous transaction by widget instance
        //
        participant =  new SharedContext(widgetInstance0).getViewer(widgetInstance0);
        assertNotNull(participant);
       
        //
        // delete all the test objects
        //
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.wookie.feature.wave.IWaveAPI#getHost(java.lang.String)
   */
  public String getHost(String id_key) {
    SharedContext sharedContext = this.getSharedContext(id_key);
    if (sharedContext != null){
      IParticipant host = sharedContext.getHost();
      if (host != null) return ParticipantHelper.createJSONParticipantDocument(host);
    }
    return null;
  }
View Full Code Here

    if (widgetInstance == null){
      state.put("message", localizedMessages.getString("WidgetAPIImpl.0"));   //$NON-NLS-1$
      return state;     
    }
    //
    for(ISharedData data : new SharedContext(widgetInstance).getSharedData()){
      state.put(data.getDkey(), data.getDvalue());
    }
    return state;
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.apache.wookie.feature.wave.IWaveAPI#getParticipants(java.lang.String)
   */
  public String getParticipants(String id_key) {
    SharedContext sharedContext = this.getSharedContext(id_key);
    if (sharedContext != null){
      return ParticipantHelper.createJSONParticipantsDocument(sharedContext.getParticipants())
    } else {
      Messages localizedMessages = LocaleHandler.localizeMessages(WebContextFactory.get().getHttpServletRequest());
      return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    }
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.apache.wookie.feature.wave.IWaveAPI#getHosts(java.lang.String)
   */
  public String getHosts(String id_key) {
    SharedContext sharedContext = this.getSharedContext(id_key);
    if (sharedContext != null){
      return ParticipantHelper.createJSONParticipantsDocument(sharedContext.getHosts())
    } else {
      Messages localizedMessages = LocaleHandler.localizeMessages(WebContextFactory.get().getHttpServletRequest());
      return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    }
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.wookie.feature.wave.IWaveAPI#getViewer(java.lang.String)
   */
  public String getViewer(String id_key) {
    SharedContext sharedContext = this.getSharedContext(id_key);
    if (sharedContext != null){
      return ParticipantHelper.createJSONParticipantDocument(sharedContext.getViewer())
    } else {
      Messages localizedMessages = LocaleHandler.localizeMessages(WebContextFactory.get().getHttpServletRequest());
      return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    }
  }
View Full Code Here

        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2"); //$NON-NLS-1$
    //
    for (String key: map.keySet())
      new SharedContext(widgetInstance).updateSharedData(key, map.get(key), false);
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
  }
View Full Code Here

 
  private SharedContext getSharedContext(String id_key){
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if (widgetInstance != null){
      return new SharedContext(widgetInstance);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.apache.wookie.beans.SharedContext

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.