本文整理汇总了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");
}
}
示例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);
}
}
示例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));
}
}
示例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;
}
示例5: CommandSupport
import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
public CommandSupport(final Class<? extends Action> actionClass) {
super(null, actionClass);
}
示例6: createNewAction
import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
protected abstract Action createNewAction(Session session);
示例7: releaseAction
import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
protected abstract void releaseAction(Action action) throws Exception;
示例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);
}
示例9: releaseAction
import org.apache.karaf.shell.api.action.Action; //导入依赖的package包/类
@Override
protected void releaseAction(final Action action) {
// no-op
}