Compare commits

...

4 Commits

3 changed files with 23 additions and 2 deletions

View File

@@ -641,6 +641,12 @@
<%
}
%>
try {
java.util.Dictionary<String, Object> jobProperties = configAdmin.getConfiguration(jobName).getProperties();
contextStr = (String)jobProperties.get("context");
} catch(java.lang.Exception e) {
}
try {
//call job/subjob with an existing context, like: --context=production. if without this parameter, there will use the default context instead.

View File

@@ -199,6 +199,16 @@ protected static void logIgnoredError(String message, Throwable cause) {
<% } %>
<% } %>
private org.osgi.service.cm.ConfigAdmin configAdmin = null;
public void setConfigAdmin(org.osgi.service.cm.ConfigAdmin configAdmin) {
this.configAdmin = configAdmin;
}
public org.osgi.service.cm.ConfigAdmin getConfigAdmin() {
return this.configAdmin;
}
<% if (talendEsbJobFactory) { %>
public TalendESBJob newTalendESBJob() {
<%=process.getName()%> talendESBJob = new <%=process.getName()%>();

View File

@@ -51,7 +51,7 @@
#if ($endpoint.useContextBean)
address="#contextBean">
#end
#end
<jaxrs:serviceBeans>
<ref component-id="serviceBean" />
</jaxrs:serviceBeans>
@@ -151,6 +151,7 @@
<bean id="job" class="${job.className}" destroy-method="destroy">
<property name="runInTalendEsbRuntimeContainer" value="true" />
<property name="configAdmin" ref="configAdmin" />
#if ($endpoint.useAuthentication && $endpoint.authenticationType == "SAML")
<property name="bus" ref="cxf" />
#end
@@ -163,7 +164,7 @@
#end
#if (!$job.dataSources.isEmpty())
<property name="dataSourceReferences">
<ref component-id="dataSourceReferenceList" />
<ref component-id="dataSourceReferenceList" />
</property>
#end
</bean>
@@ -186,10 +187,14 @@
]]#
#end
<reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
#if ($endpoint.useContextBean)
<bean id="contextBean" class="${job.className}.ContextBean" factory-method="getContext">
<argument value="${endpoint.defaultContext}" />
<argument value="${endpoint.address}" />
<argument ref="configAdmin" />
<argument value="${job.className}" />
</bean>
#end
#if (!$job.dataSources.isEmpty())