You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by sa...@apache.org on 2014/07/08 19:28:47 UTC
svn commit: r1608856 - in /axis/axis2/java/core/branches/1_6: ./
modules/integration/test/org/apache/axis2/deployment/
modules/kernel/src/org/apache/axis2/engine/
Author: sagara
Date: Tue Jul 8 17:28:47 2014
New Revision: 1608856
URL: http://svn.apache.org/r1608856
Log:
Merged r1608843 into 1.6 branch
Added:
axis/axis2/java/core/branches/1_6/modules/integration/test/org/apache/axis2/deployment/Service.java
- copied unchanged from r1608843, axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/deployment/Service.java
Modified:
axis/axis2/java/core/branches/1_6/ (props changed)
axis/axis2/java/core/branches/1_6/modules/integration/test/org/apache/axis2/deployment/LifecycleTest.java
axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java
Propchange: axis/axis2/java/core/branches/1_6/
------------------------------------------------------------------------------
Merged /axis/axis2/java/core/trunk:r1608843
Modified: axis/axis2/java/core/branches/1_6/modules/integration/test/org/apache/axis2/deployment/LifecycleTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/integration/test/org/apache/axis2/deployment/LifecycleTest.java?rev=1608856&r1=1608855&r2=1608856&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_6/modules/integration/test/org/apache/axis2/deployment/LifecycleTest.java (original)
+++ axis/axis2/java/core/branches/1_6/modules/integration/test/org/apache/axis2/deployment/LifecycleTest.java Tue Jul 8 17:28:47 2014
@@ -19,24 +19,10 @@
package org.apache.axis2.deployment;
-import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.integration.LocalTestCase;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.service.Lifecycle;
public class LifecycleTest extends LocalTestCase {
- static public class Service implements Lifecycle {
- static boolean initCalled, destroyCalled;
-
- public void init(ServiceContext context) throws AxisFault {
- initCalled = true;
- }
-
- public void destroy(ServiceContext context) {
- destroyCalled = true;
- }
- }
public void testServiceObjectLifecycle() throws Exception {
deployClassAsService("lifecycle", Service.class, Constants.SCOPE_APPLICATION);
Modified: axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java?rev=1608856&r1=1608855&r2=1608856&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java (original)
+++ axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java Tue Jul 8 17:28:47 2014
@@ -27,8 +27,10 @@ import org.apache.axis2.context.ServiceG
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.AxisServiceGroup;
import org.apache.axis2.description.Parameter;
+import org.apache.axis2.i18n.Messages;
import org.apache.axis2.service.Lifecycle;
import org.apache.axis2.util.Loader;
+import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -127,7 +129,7 @@ public class DependencyManager {
Class implClass = Loader.loadClass(
classLoader,
((String) implInfoParam.getValue()).trim());
- Object serviceImpl = implClass.newInstance();
+ Object serviceImpl = makeNewServiceObject(service);
serviceContext.setProperty(ServiceContext.SERVICE_OBJECT, serviceImpl);
initServiceObject(serviceImpl, serviceContext);
} catch (Exception e) {
@@ -136,6 +138,17 @@ public class DependencyManager {
}
}
}
+
+ protected static Object makeNewServiceObject(AxisService service) throws AxisFault {
+ Object serviceObject = Utils.createServiceObject(service);
+ if (serviceObject == null) {
+ throw new AxisFault(
+ Messages.getMessage("paramIsNotSpecified", "SERVICE_OBJECT_SUPPLIER"));
+ } else {
+ return serviceObject;
+ }
+ }
+
/**
* Notify a service object that it's on death row.