当前位置: 首页>>代码示例>>Java>>正文


Java Action类代码示例

本文整理汇总了Java中org.apache.karaf.shell.api.action.Action的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Action类属于org.apache.karaf.shell.api.action包,在下文中一共展示了Action类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ActionRegistrar

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Inject
public ActionRegistrar(final BeanLocator beanLocator,
                       @Nullable final SessionFactory sessionFactory,
                       @Nullable final BundleContext bundleContext)
{
  this.beanLocator = checkNotNull(beanLocator);
  this.sessionFactory = sessionFactory; // might be null during tests

  // HACK: BundleContext may be null in present injected-UT environment
  if (bundleContext != null) {
    beanLocator.watch(Key.get(Action.class, Named.class), new ActionMediator(), bundleContext);
  }
  else {
    log.warn("BundleContext is not available, unable to watch action components for registration");
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:17,代码来源:ActionRegistrar.java

示例2: add

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
public void add(final BeanEntry<Named, Action> beanEntry, final BundleContext bundleContext) throws Exception {
  Command command = beanEntry.getImplementationClass().getAnnotation(Command.class);
  if (command != null) {
    log.debug("Registering command: {}", beanEntry);
    sessionFactory.getRegistry().register(new BeanEntryCommand(beanLocator, beanEntry));
  }
  else {
    log.warn("Missing @Command annotation on action: {}", beanEntry);
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:12,代码来源:ActionRegistrar.java

示例3: remove

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
public void remove(final BeanEntry<Named, Action> beanEntry, final BundleContext bundleContext) throws Exception {
  Command command = beanEntry.getImplementationClass().getAnnotation(Command.class);
  if (command != null) {
    log.debug("Unregistering command: {}", beanEntry);
    sessionFactory.getRegistry().unregister(new BeanEntryCommand(beanLocator, beanEntry));
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:9,代码来源:ActionRegistrar.java

示例4: createNewAction

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
protected Action createNewAction(final Session session) {
  Action action = beanEntry.getProvider().get(); // create new instance each time
  if (action instanceof SessionAware) {
    ((SessionAware) action).setSession(session);
  }
  return action;
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:9,代码来源:BeanEntryCommand.java

示例5: CommandSupport

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
public CommandSupport(final Class<? extends Action> actionClass) {
  super(null, actionClass);
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:4,代码来源:CommandSupport.java

示例6: createNewAction

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
protected abstract Action createNewAction(Session session);
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:3,代码来源:CommandSupport.java

示例7: releaseAction

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
protected abstract void releaseAction(Action action) throws Exception;
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:3,代码来源:CommandSupport.java

示例8: BeanEntryCommand

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
public BeanEntryCommand(final BeanLocator beanLocator, final BeanEntry<?, Action> beanEntry) {
  super(beanEntry.getImplementationClass());

  this.beanLocator = checkNotNull(beanLocator);
  this.beanEntry = checkNotNull(beanEntry);
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:7,代码来源:BeanEntryCommand.java

示例9: releaseAction

import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
protected void releaseAction(final Action action) {
  // no-op
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:5,代码来源:BeanEntryCommand.java


注:本文中的org.apache.karaf.shell.api.action.Action类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。