- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下组件:
@Component(
label = "Service name",
description = "Service description",
metatype = true,
immediate = false)
@Properties({
@Property(
label = "My Label"
name = "property-name",
value = "my value",
propertyPrivate = true
)
})
@Service
public class SampleServiceImpl implements SampleService {
private final Logger log =
LoggerFactory.getLogger(this.getClass());
/**
* OSGi Properties *
*/
private static final String DEFAULT_SAMPLE = "hello!";
private String mySample = DEFAULT_SAMPLE;
@Property(label = "Prop name",
description = "Prop description",
value = DEFAULT_SAMPLE)
public static final String PROP_SAMPLE = "sample";
...
@Activate
protected void activate(final Map<String, String> config) {
mySample = PropertiesUtil.toString(config.get(PROP_SAMPLE), DEFAULT_SAMPLE);
}
@Deactivate
protected void deactivate(final Map<String, String> config) { }
}
是在cq启动后注册的。这是预期的行为。
如何开始?我找不到这个界面。
最佳答案
是的,这是非直接组件的预期行为。来自 a blog post作者:Felix Meschberger 在 dev.day.com 上,
The OSGi Declarative services specification defines three types of components:
Immediate Components are immediately created when the providing bundle is started and may or may not provide services
Delayed Components provide services but are only created when used by a service consumer.
Factory Components are created on demand by calling the ComponentFactory.newInstance(Dictionary) method of the Component Factory service registered for the component.
因此,如果您设置 immediate = false
,您将拥有一个延迟组件,它由运行时按需激活 — 您不需要自己显式启动该组件。
您应该检查的主要内容是组件处于“已启用”或“已注册”状态(正如您提到的那样)而不是“不满意”(它找不到对它需要的依赖项)。
From the Felix documentation ……
STATE_REGISTERED
The Component has successfully been activated but is a Delayed or Service Factory Component pending instantiation on first use (value is 32).
关于java - 如何启动 immediate = false 组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31860088/
我正在阅读一些有关使用 curses 用 c 编写的旧银行柜员管理工具的源代码,这里有一些我无法理解的代码: main(int argc, char *argv[]) { int h1, h2
我已经在 Google Play 商店中启动了应用程序,对于该应用程序,我需要实现立即应用程序更新,以解决已经在使用我的应用程序的问题 我已经尝试过 Github 示例,这些示例是灵活更新而不是立即更
我有简单的启动服务功能并重复他: mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE); Pe
我需要一个 EXECUTE IMMEDIATE 将其结果返回到一个表类型(AS TABLE OF)中 如果立即执行返回单个值,我可以使用“INTO somevariable”保存结果 但是,我的立即执
只是想知道这是否是对多列和多行执行立即执行并将其分配给变量的正确方法?我尝试查看示例,但不确定我是否正确连接了这些行? sql_stmt VARCHAR2(200); sql_stmt:
我来自 Eclipse,我习惯于立即报告整个项目的错误。 假设我有这个功能: public void test() { //Do something } 我把它改成 public void te
什么是“立即模式”?给出一个代码示例。 什么时候必须使用立即模式而不是保留模式?使用每种方法的优点和缺点是什么? 最佳答案 “立即模式”的一个示例是使用 glBegin和glEnd与 glVertex
我有一个使用 EXECUTE IMMEDIATE 调用的存储过程。我面临的问题是,直接调用过程与使用 EXECUTE IMMEDIATE 调用过程时的解释计划不同。这导致执行时间增加了 5 倍。计划之
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我有一个表,其中存储了某些条件以及输入参数,如下所示: CONDITION | INPUT_PARAMS ----------------------
我有一个网络应用程序,它创建一些自定义消息并将它们按顺序缓冲在 FIFO 队列中,直到调用 send() 方法,然后所有这些消息都被传输到它们的预期目的地。 还需要提供一种允许“立即发送”功能的方法,
如果存储过程旨在减轻 SQL 注入(inject)攻击,为什么在存储过程中允许 EXECUTE IMMEDIATE?以下问题的公认答案将它们称为针对此类攻击的步骤: What is a stored
我有一个关于“立即执行”的问题。 我在下一个 plsql 语句中动态更改了表名 DECLARE TYPE CurTyp IS REF CURSOR; cur CurTyp; str1 VARCHAR2
最初 immediate标志仅用于 ActionSource界面。但后来它被添加到 EditableValueHolder界面也。设计决策的原因是什么? 最佳答案 它用于对多个 EditableVal
这个问题是关于不允许“创建”权限的环境。 版本是: Oracle 数据库 10g 和 PL/SQL 8.0.0.1480 下面是一个小示例,展示了我正在尝试完成的任务,即循环遍历集合中的一组“字段”并
我有一个使用 EXECUTE IMMEDIATE 的存储过程命令执行一个很长的字符串。如何支持很长的字符串并将数据返回到refcursor? 最佳答案 假设您的 SQL 不超过 32K(正如@Tony
嗨,我真的是 Jsf 和 Primefaces 世界的新手,我有一个关于 Primefaces 轮询组件的简单查询,如下所示。 我有一个登录页面,一旦用户通过身份验证,我将他重定向到welcome.x
在调试断点中,是否可以尝试Dart表达式并执行命令? 就像在Chrome Developer Bar,Firebug或Visual Studio立即窗口中一样。 最佳答案 不幸的是还没有。 标记htt
这个问题已经有答案了: Create user from string variables in a PL/SQL block (1 个回答) 已关闭 6 年前。 我正在 Oracle 数据库上编写
我有以下组件: @Component( label = "Service name", description = "Service description", metatyp
我是一名优秀的程序员,十分优秀!