Examples of Scoped


Examples of juzu.impl.inject.Scoped

  }

  public void close() {
    if (state != null && state.size() > 0) {
      for (Iterator<Scoped> i = state.values().iterator();i.hasNext();) {
        Scoped scoped = i.next();
        i.remove();
        try {
          scoped.destroy();
        }
        catch (Throwable t) {
          log.info("Error when destroying object", t);
        }
      }
View Full Code Here

Examples of org.jvnet.hk2.annotations.Scoped

  /**
   * Creates a {@link Inhabitant} by wrapping {@link Creator} to handle scoping right.
   */
  public static <T> Inhabitant<T> wrapByScope(Class<T> c, Creator<T> creator, Habitat habitat) {
      Scoped scoped = c.getAnnotation(Scoped.class);
      if (scoped==null) {
          return new SingletonInhabitant<T>(creator); // treated as singleton
      }

      Class<? extends Scope> scopeClass = scoped.value();

      return wrapByScope(creator, habitat, scopeClass);
  }
View Full Code Here

Examples of org.jvnet.hk2.annotations.Scoped

            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            LogHelper.getDefaultLogger().info(msg);
            return null;
        }

        Scoped scoped = command.getClass().getAnnotation(Scoped.class);
        if (scoped == null) {
            String msg = adminStrings.getLocalString("adapter.command.noscope",
                    "Implementation for the command {0} exists in the " +
                    "system,\nbut it has no @Scoped annotation", commandName);
            report.setMessage(msg);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            LogHelper.getDefaultLogger().info(msg);
            command = null;
        } else if (scoped.value() == Singleton.class) {
            // check that there are no parameters for this command
            CommandModel model = getModel(command);
            if (model.getParameters().size() > 0) {
                String msg =
                    adminStrings.getLocalString("adapter.command.hasparams",
View Full Code Here

Examples of org.jvnet.hk2.annotations.Scoped

            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            LogHelper.getDefaultLogger().info(msg);
            return null;
        }

        Scoped scoped = command.getClass().getAnnotation(Scoped.class);
        if (scoped == null) {
            String msg = adminStrings.getLocalString("adapter.command.noscope",
                    "Implementation for the command {0} exists in the "
                    + "system,\nbut it has no @Scoped annotation", commandName);
            report.setMessage(msg);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            LogHelper.getDefaultLogger().info(msg);
            command = null;
        } else if (scoped.value() == Singleton.class) {
            // check that there are no parameters for this command
            CommandModel model = getModel(command);
            if (model.getParameters().size() > 0) {
                String msg =
                        adminStrings.getLocalString("adapter.command.hasparams",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.