IDEMPIERE-840 Improvement to Request model class - combine the requestservice.xml and requesteventhandler.xml into one. Use class name as the pid.

This commit is contained in:
Elaine Tan 2013-07-31 15:31:58 +08:00
parent f5fb6f7d37
commit 92532db6de
5 changed files with 11 additions and 19 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> <metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0">
<OCD description="Request Service" name="Request Service" id="org.adempiere.base.event.request.service"> <OCD description="Request Service" name="Request Service" id="org.adempiere.base.event.RequestEventHandler">
<AD name="Ignore Request Types" id="ignoreRequestTypes" required="true" type="String" default=""/> <AD name="Ignore Request Types" id="ignoreRequestTypes" required="true" type="String" default=""/>
</OCD> </OCD>
<Designate pid="org.adempiere.base.event.request.service"> <Designate pid="org.adempiere.base.event.RequestEventHandler">
<Object ocdref="org.adempiere.base.event.request.service"/> <Object ocdref="org.adempiere.base.event.RequestEventHandler"/>
</Designate> </Designate>
</metatype:MetaData> </metatype:MetaData>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.base.event.RequestEventHandler"> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" configuration-policy="require" name="org.adempiere.base.event.RequestEventHandler">
<implementation class="org.adempiere.base.event.RequestEventHandler"/> <implementation class="org.adempiere.base.event.RequestEventHandler"/>
<reference bind="bindEventManager" cardinality="1..1" interface="org.adempiere.base.event.IEventManager" name="IEventManager" policy="static" unbind="unbindEventManager"/> <reference bind="bindEventManager" cardinality="1..1" interface="org.adempiere.base.event.IEventManager" name="IEventManager" policy="static" unbind="unbindEventManager"/>
<service>
<provide interface="org.osgi.service.cm.ManagedService"/>
<provide interface="org.adempiere.base.event.RequestEventHandler"/>
</service>
<property name="service.pid" type="String" value="org.adempiere.base.event.RequestEventHandler"/>
</scr:component> </scr:component>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" configuration-policy="require" name="org.adempiere.base.event.request.service">
<implementation class="org.adempiere.base.event.RequestEventHandler"/>
<property name="service.ranking" type="Integer" value="1"/>
<service>
<provide interface="org.osgi.service.cm.ManagedService"/>
<provide interface="org.adempiere.base.event.RequestEventHandler"/>
</service>
<property name="service.pid" type="String" value="org.adempiere.base.event.request.service"/>
</scr:component>

View File

@ -29,7 +29,6 @@ bin.includes = META-INF/,\
OSGI-INF/defaultpaymentprocessorfactory.xml,\ OSGI-INF/defaultpaymentprocessorfactory.xml,\
OSGI-INF/broadcastutil.xml,\ OSGI-INF/broadcastutil.xml,\
OSGI-INF/requesteventhandler.xml,\ OSGI-INF/requesteventhandler.xml,\
OSGI-INF/requestservice.xml,\
OSGI-INF/requestpropertyservice.xml,\ OSGI-INF/requestpropertyservice.xml,\
schema/ schema/
output.base.jar = build/ output.base.jar = build/

View File

@ -23,7 +23,6 @@ import java.util.Hashtable;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.base.event.RequestEventHandler;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.Ini; import org.compiere.util.Ini;
import org.compiere.util.Util; import org.compiere.util.Util;
@ -65,7 +64,7 @@ public class RequestPropertyService {
String ignoreRequesTypes = p.getProperty(RequestEventHandler.IGNORE_REQUEST_TYPES); String ignoreRequesTypes = p.getProperty(RequestEventHandler.IGNORE_REQUEST_TYPES);
if (!Util.isEmpty(ignoreRequesTypes)) { if (!Util.isEmpty(ignoreRequesTypes)) {
Configuration configuration = service.getConfiguration("org.adempiere.base.event.request.service"); Configuration configuration = service.getConfiguration(RequestEventHandler.class.getName());
if (configuration.getProperties() == null) { if (configuration.getProperties() == null) {
Dictionary<String, Object> map = new Hashtable<String, Object>(); Dictionary<String, Object> map = new Hashtable<String, Object>();
map.put(RequestEventHandler.IGNORE_REQUEST_TYPES, ignoreRequesTypes); map.put(RequestEventHandler.IGNORE_REQUEST_TYPES, ignoreRequesTypes);