Package org.exoplatform.commons.chromattic

Examples of org.exoplatform.commons.chromattic.SessionContext


    */
   private abstract class TokenTask<V> extends ContextualTask<V>
   {

      protected final TokenContainer getTokenContainer() {
         SessionContext ctx = chromatticLifeCycle.getContext();
         ChromatticSession session = ctx.getSession();
         TokenContainer container = session.findByPath(TokenContainer.class, lifecycleName);
         if (container == null)
         {
            container = session.insert(TokenContainer.class, lifecycleName);
         }
View Full Code Here


    *
    * @return the current session
    */
   public POMSession getSession()
   {
      SessionContext context = configurator.getContext();
      return context != null ? (POMSession)context.getAttachment("mopsession") : null;
   }
View Full Code Here

    *
    * @return a session to the model.
    */
   public POMSession openSession()
   {
      SessionContext context = configurator.openContext();
      return (POMSession)context.getAttachment("mopsession");
   }
View Full Code Here

     * </p>
     *
     * @return the current session
     */
    public POMSession getSession() {
        SessionContext context = configurator.getContext();
        return context != null ? (POMSession) context.getAttachment("mopsession") : null;
    }
View Full Code Here

     * </p>
     *
     * @return a session to the model.
     */
    public POMSession openSession() {
        SessionContext context = configurator.openContext();
        return (POMSession) context.getAttachment("mopsession");
    }
View Full Code Here

    *
    * @return the current session
    */
   public POMSession getSession()
   {
      SessionContext context = configurator.getContext();
      return context != null ? (POMSession)context.getAttachment("mopsession") : null;
   }
View Full Code Here

    *
    * @return a session to the model.
    */
   public POMSession openSession()
   {
      SessionContext context = configurator.openContext();
      return (POMSession)context.getAttachment("mopsession");
   }
View Full Code Here

    public void start() {
        /* clean the legacy tokens */
        new TokenTask<Void>() {
            @Override
            protected Void execute(SessionContext context) {
                SessionContext ctx = chromatticLifeCycle.getContext();
                ChromatticSession session = ctx.getSession();
                TokenContainer container = session.findByPath(TokenContainer.class, lifecycleName);
                if (container != null) {
                    /* if the container does not exist, it makes no sense to clean the legacy tokens */
                    container.cleanLegacyTokens();
                }
View Full Code Here

     * @param <V> the return type
     */
    private abstract class TokenTask<V> extends ContextualTask<V> {

        protected final TokenContainer getTokenContainer() {
            SessionContext ctx = chromatticLifeCycle.getContext();
            ChromatticSession session = ctx.getSession();
            TokenContainer container = session.findByPath(TokenContainer.class, lifecycleName);
            if (container == null) {
                container = session.insert(TokenContainer.class, lifecycleName);
            }
            return container;
View Full Code Here

            }
            return container;
        }

        protected final <A> A getMixin(Object o, Class<A> type) {
            SessionContext ctx = chromatticLifeCycle.getContext();
            ChromatticSession session = ctx.getSession();
            return session.getEmbedded(o, type);
        }
View Full Code Here

TOP

Related Classes of org.exoplatform.commons.chromattic.SessionContext

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.