Author: ruwan
Date: Wed Apr 22 20:03:21 2009
New Revision: 33917
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=33917
Log:
* Adding declarative services
* Adding svn:ignore properties
Added:
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ServiceBusInitializer.java
- copied, changed from r33892,
/trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java
Removed:
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java
trunk/esb/java/svnignore.txt
Modified:
trunk/esb/java/ (props changed)
trunk/esb/java/modules/core/ (props changed)
trunk/esb/java/modules/core/pom.xml
trunk/esb/java/modules/distribution/ (props changed)
trunk/esb/java/modules/samples/ (props changed)
trunk/esb/java/modules/styles/ (props changed)
trunk/esb/java/modules/styles/src/main/resources/META-INF/product.xml
Modified: trunk/esb/java/modules/core/pom.xml
URL:
http://wso2.org/svn/browse/wso2/trunk/esb/java/modules/core/pom.xml?rev=33917&r1=33916&r2=33917&view=diff
==============================================================================
--- trunk/esb/java/modules/core/pom.xml (original)
+++ trunk/esb/java/modules/core/pom.xml Wed Apr 22 20:03:21 2009
@@ -106,6 +106,19 @@
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ <version>1.0.10</version>
+ <executions>
+ <execution>
+ <id>generate-scr-scrdescriptor</id>
+ <goals>
+ <goal>scr</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
@@ -114,7 +127,7 @@
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${pom.artifactId}</Bundle-Name>
<Bundle-Version>1.0.0</Bundle-Version>
-
<Bundle-Activator>org.wso2.esb.core.ESBActivator</Bundle-Activator>
+
<!--<Bundle-Activator>org.wso2.esb.core.ServiceBusInitializer</Bundle-Activator>-->
<WSO2-Bundle-StartLevel>65</WSO2-Bundle-StartLevel>
<Export-Package>
org.wso2.esb.core.*; version=1.0.0,
Deleted:
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java
URL: http://wso2.org/svn/browse/wso2/None?pathrev=33916
Copied:
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ServiceBusInitializer.java
(from r33892,
/trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java)
URL:
http://wso2.org/svn/browse/wso2/trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ServiceBusInitializer.java?rev=33917&r1=33892&r2=33917&view=diff
==============================================================================
---
/trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java
(original)
+++
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ServiceBusInitializer.java
Wed Apr 22 20:03:21 2009
@@ -1,53 +1,56 @@
+/*
+ * Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.wso2.esb.core;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.Parameter;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.synapse.*;
-import org.apache.synapse.config.SynapseConfiguration;
-import org.apache.synapse.core.SynapseEnvironment;
import org.osgi.framework.*;
+import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.utils.ConfigurationContextService;
import java.io.File;
/**
- *
+ * @scr.component name="esb.core.initializer" immediate="true"
+ * @scr.reference name="config.context.service"
interface="org.wso2.carbon.utils.ConfigurationContextService"
cardinality="1..1" policy="dynamic" bind="setConfigurationContextService"
unbind="unsetConfigurationContextService"
*/
-public class ESBActivator implements BundleActivator, BundleListener {
+public class ServiceBusInitializer {
- BundleContext bundleContext;
-
- private static final Log log = LogFactory.getLog(ESBActivator.class);
+ private static final Log log =
LogFactory.getLog(ServiceBusInitializer.class);
- public void start(BundleContext bundleContext) throws Exception {
- this.bundleContext = bundleContext;
- bundleContext.addBundleListener(this);
- }
-
- public void stop(BundleContext bundleContext) throws Exception {
- bundleContext.removeBundleListener(this);
- }
+ BundleContext bundleContext;
- public void bundleChanged(BundleEvent event) {
-
- if
(!event.getBundle().getSymbolicName().equals("org.wso2.carbon.core")) {
- return;
+ protected void activate(ComponentContext ctxt) {
+ this.bundleContext = ctxt.getBundleContext();
+ try {
+ initESB();
+ } catch (Exception e) {
+ String message = "Couldn't initialize the ESB...";
+ log.fatal(message, e);
+ throw new RuntimeException(message);
}
+ }
- if (event.getType() == BundleEvent.STARTED) {
- try {
- initESB();
- } catch (Exception e) {
- String message = "Couldn't initialize the ESB...";
- log.fatal(message, e);
- throw new RuntimeException(message);
- }
- }
+ protected void deactivate(ComponentContext ctxt) {
}
private void initESB() throws AxisFault {
@@ -62,7 +65,8 @@
ServerConfigurationInformation configurationInformation =
ServerConfigurationInformationFactory.createServerConfigurationInformation(
configContext.getAxisConfiguration());
-
+
+ configurationInformation.setCreateNewInstance(false);
if (System.getProperty("esb.sample") != null) {
configurationInformation.setSynapseXMLLocation("repository" +
File.separator
+ "samples" + File.separator + "synapse_sample_"
@@ -79,34 +83,14 @@
AxisServiceGroup serviceGroup = axisConf.getServiceGroup(
SynapseConstants.SYNAPSE_SERVICE_NAME);
serviceGroup.addParameter("hiddenService", "true");
-
-// Parameter synEnv
-// =
axisConf.getParameter(SynapseConstants.SYNAPSE_ENV);
-// Parameter synCfg
-// =
axisConf.getParameter(SynapseConstants.SYNAPSE_CONFIG);
-//
-// String message = "Unable to initialize the Synapse
Configuration : Cannot find the ";
-// if (synCfg == null || synCfg.getValue() == null
-// || !(synCfg.getValue() instanceof
SynapseConfiguration)) {
-// return;
-// } else {
-// synConfig = (SynapseConfiguration) synCfg.getValue();
-// }
-//
-// if (synEnv == null || synEnv.getValue() == null
-// || !(synEnv.getValue() instanceof
SynapseEnvironment)) {
-// return;
-// } else {
-//
-// ((SynapseEnvironment)
synEnv.getValue()).setInitialized(true);
-//
-// // initialize the startups
-// for (Startup stp : synConfig.getStartups()) {
-// if (stp != null) {
-// stp.init((SynapseEnvironment) synEnv.getValue());
-// }
-// }
-// }
}
}
+
+ protected void setConfigurationContextService(ConfigurationContextService
configurationContextService) {
+ log.info("ConfigContextService available");
+ }
+
+ protected void
unsetConfigurationContextService(ConfigurationContextService
configurationContextService) {
+ log.info("ConfigContextService unavailable");
+ }
}
Modified: trunk/esb/java/modules/styles/src/main/resources/META-INF/product.xml
URL:
http://wso2.org/svn/browse/wso2/trunk/esb/java/modules/styles/src/main/resources/META-INF/product.xml?rev=33917&r1=33916&r2=33917&view=diff
==============================================================================
--- trunk/esb/java/modules/styles/src/main/resources/META-INF/product.xml
(original)
+++ trunk/esb/java/modules/styles/src/main/resources/META-INF/product.xml
Wed Apr 22 20:03:21 2009
@@ -1,7 +1,7 @@
<product xmlns="http://products.wso2.org/carbon">
<properties>
<property name="userforum">http://wso2.org/forum/187</property>
- <property
name="userguide">http://wso2.org/project/esb/java/2.0/docs/index.html</property>
+ <property
name="userguide">http://wso2.org/project/esb/java/2.1/docs/index.html</property>
<property name="mailinglist">http://wso2.org/mail</property>
<property
name="issuetracker">https://wso2.org/jira/browse/ESBJAVA</property>
</properties>
Deleted: trunk/esb/java/svnignore.txt
URL: http://wso2.org/svn/browse/wso2/None?pathrev=33916
_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev