Project

General

Profile

« Previous | Next » 

Revision 47832

[maven-release-plugin] copy for tag cnr-enabling-hcm-service-2.0.1

View differences:

modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/cnr-enabling-hcm-service.iml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
4
    <output url="file://$MODULE_DIR$/target/classes" />
5
    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
    <content url="file://$MODULE_DIR$">
7
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
      <excludeFolder url="file://$MODULE_DIR$/target" />
10
    </content>
11
    <orderEntry type="inheritedJdk" />
12
    <orderEntry type="sourceFolder" forTests="false" />
13
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-notifications-common:2.1.1-SNAPSHOT" level="project" />
14
    <orderEntry type="module" module-name="cnr-service-common" />
15
    <orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" />
16
    <orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" />
17
    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.5.RELEASE" level="project" />
18
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.5.RELEASE" level="project" />
19
    <orderEntry type="module" module-name="cnr-misc-utils" />
20
    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
21
    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
22
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
23
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
24
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
25
    <orderEntry type="library" name="Maven: saxonica:saxon:9.1.0.8" level="project" />
26
    <orderEntry type="library" name="Maven: saxonica:saxon-dom:9.1.0.8" level="project" />
27
    <orderEntry type="library" name="Maven: jgrapht:jgrapht:0.7.2" level="project" />
28
    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.8.0" level="project" />
29
    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
30
    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.2.5.RELEASE" level="project" />
31
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-utils:1.0.2-SNAPSHOT" level="project" />
32
    <orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" />
33
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.5" level="project" />
34
    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
35
    <orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
36
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.5" level="project" />
37
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.5" level="project" />
38
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
39
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.5" level="project" />
40
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
41
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
42
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.5" level="project" />
43
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.5" level="project" />
44
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.5" level="project" />
45
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.5" level="project" />
46
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
47
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-rmi-api:2.6.1-SNAPSHOT" level="project" />
48
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.5" level="project" />
49
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
50
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
51
    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" />
52
    <orderEntry type="module" module-name="cnr-spring-utils" />
53
    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
54
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.2.5.RELEASE" level="project" />
55
    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
56
    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.2.5.RELEASE" level="project" />
57
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.2.5.RELEASE" level="project" />
58
    <orderEntry type="library" name="Maven: jparsec:jparsec:2.0" level="project" />
59
    <orderEntry type="library" name="Maven: runcc:runcc:0.7" level="project" />
60
    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.2.5.RELEASE" level="project" />
61
    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.2.5.RELEASE" level="project" />
62
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.5.RELEASE" level="project" />
63
    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.2.5.RELEASE" level="project" />
64
    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
65
    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" />
66
    <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" />
67
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
68
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
69
  </component>
70
</module>
modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/deploy.info
1
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/cnr-enabling-hcm-service/trunk/", "deploy_repository": "dnet45-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", "name": "cnr-enabling-hcm-service"}
modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/src/main/java/eu/dnetlib/enabling/hcm/sn/HCMSubscriptionListFactory.java
1
package eu.dnetlib.enabling.hcm.sn;
2

  
3
import java.util.List;
4

  
5
import com.google.common.collect.Lists;
6
import eu.dnetlib.enabling.actions.SubscriptionAction;
7
import org.springframework.beans.factory.FactoryBean;
8
import org.springframework.beans.factory.annotation.Autowired;
9

  
10
/**
11
 * This class acts as a simple registry of msro subscription actions.
12
 * 
13
 * <p>
14
 * Subscription actions are autodetected using spring autowiring from the current application context and are available for the manager for
15
 * handling subscriptions and delivering notification to particular code interested in those notifications.
16
 * </p>
17
 * 
18
 * @author marko
19
 * 
20
 */
21
@SuppressWarnings("rawtypes")
22
public class HCMSubscriptionListFactory implements FactoryBean<List<SubscriptionAction>> {
23

  
24
	/**
25
	 * actions. Spring injects all the declared SubscriptionActions here.
26
	 */
27
	@Autowired(required = false)
28
	private List<SubscriptionAction> actions = Lists.newArrayList();
29

  
30
	public List<SubscriptionAction> getActions() {
31
		return actions;
32
	}
33

  
34
	public void setActions(final List<SubscriptionAction> actions) {
35
		this.actions = actions;
36
	}
37

  
38
	/**
39
	 * {@inheritDoc}
40
	 * 
41
	 * @see org.springframework.beans.factory.FactoryBean#getObject()
42
	 */
43
	@Override
44
	public List<SubscriptionAction> getObject() {
45
		return getActions();
46
	}
47

  
48
	@Override
49
	public Class<List> getObjectType() {
50
		return List.class;
51
	}
52

  
53
	@Override
54
	public boolean isSingleton() {
55
		return false;
56
	}
57
}
modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/src/main/java/eu/dnetlib/enabling/hcm/sn/HCMSubscriber.java
1
package eu.dnetlib.enabling.hcm.sn;
2

  
3
import eu.dnetlib.enabling.is.sn.rmi.ISSNException;
4

  
5
/**
6
 * This component takes care of subscribing the MSRO service to interesting events.
7
 * 
8
 * @author marko
9
 *
10
 */
11
public interface HCMSubscriber {
12
	/**
13
	 * performs the subscription.
14
	 * @throws ISSNException could happen
15
	 */
16
	void subscribeAll() throws ISSNException;
17
}
modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/src/main/java/eu/dnetlib/enabling/hcm/sn/HCMSubscriberImpl.java
1
package eu.dnetlib.enabling.hcm.sn;
2

  
3
import java.util.List;
4

  
5
import javax.annotation.PostConstruct;
6
import javax.annotation.Resource;
7
import javax.xml.ws.Endpoint;
8
import javax.xml.ws.wsaddressing.W3CEndpointReference;
9

  
10
import org.apache.commons.logging.Log;
11
import org.apache.commons.logging.LogFactory;
12
import org.springframework.beans.factory.annotation.Required;
13

  
14
import eu.dnetlib.enabling.actions.SubscriptionAction;
15
import eu.dnetlib.enabling.is.sn.rmi.ISSNException;
16
import eu.dnetlib.enabling.is.sn.rmi.ISSNService;
17
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
18
import eu.dnetlib.soap.EndpointReferenceBuilder;
19

  
20
/**
21
 * This component takes care of subscribing the SubscriptionAction(s) to interesting events.
22
 * 
23
 * @author claudio
24
 * 
25
 */
26
public class HCMSubscriberImpl implements HCMSubscriber {
27

  
28
	/**
29
	 * logger.
30
	 */
31
	private static final Log log = LogFactory.getLog(HCMSubscriberImpl.class);
32

  
33
	/**
34
	 * notification endpoint (normally the msro service).
35
	 */
36
	private Endpoint endpoint;
37

  
38
	/**
39
	 * service locator.
40
	 */
41
	private UniqueServiceLocator serviceLocator;
42

  
43
	/**
44
	 * injected EPR builder.
45
	 */
46
	@Resource(name = "jaxwsEndpointReferenceBuilder")
47
	private EndpointReferenceBuilder<Endpoint> eprBuilder;
48

  
49
	/**
50
	 * subscription actions.
51
	 */
52
	private List<SubscriptionAction> actions;
53

  
54
	@PostConstruct
55
	public void printList() {
56
		log.info(getActions());
57
	}
58

  
59
	/**
60
	 * {@inheritDoc}
61
	 * 
62
	 * @throws ISSNException
63
	 *             could happen
64
	 * @see eu.dnetlib.enabling.hcm.sn.HCMSubscriber#subscribeAll()
65
	 */
66
	@Override
67
	public void subscribeAll() throws ISSNException {
68

  
69
		final W3CEndpointReference endpointReference = eprBuilder
70
				.getEndpointReference(getEndpoint());
71

  
72
		if (getActions() != null) {
73
			for (final SubscriptionAction action : getActions()) {
74
				log.info("dynamically subscribing to "
75
						+ action.getTopicExpression());
76
				serviceLocator.getService(ISSNService.class, true).subscribe(endpointReference,
77
						action.getTopicExpression(), 0);
78
			}
79
		}
80
	}
81

  
82
	public void setEndpoint(final Endpoint endpoint) {
83
		this.endpoint = endpoint;
84
	}
85

  
86
	public Endpoint getEndpoint() {
87
		return endpoint;
88
	}
89

  
90
	public void setEprBuilder(
91
			final EndpointReferenceBuilder<Endpoint> eprBuilder) {
92
		this.eprBuilder = eprBuilder;
93
	}
94

  
95
	public EndpointReferenceBuilder<Endpoint> getEprBuilder() {
96
		return eprBuilder;
97
	}
98

  
99
	public List<SubscriptionAction> getActions() {
100
		return actions;
101
	}
102

  
103
	@Required
104
	public void setActions(final List<SubscriptionAction> actions) {
105
		this.actions = actions;
106
	}
107

  
108
	public UniqueServiceLocator getServiceLocator() {
109
		return serviceLocator;
110
	}
111

  
112
	@Required
113
	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
114
		this.serviceLocator = serviceLocator;
115
	}
116

  
117
}
modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/src/main/java/eu/dnetlib/enabling/hcm/HostingContextManagerServiceImpl.java
1
package eu.dnetlib.enabling.hcm;
2

  
3
import org.apache.commons.logging.Log;
4
import org.apache.commons.logging.LogFactory;
5
import org.springframework.beans.factory.annotation.Required;
6

  
7
import eu.dnetlib.enabling.hcm.rmi.HostingContextManagerService;
8
import eu.dnetlib.enabling.tools.AbstractBaseService;
9
import eu.dnetlib.enabling.tools.blackboard.NotificationHandler;
10

  
11
/**
12
 * CNR HostingContextManagerService implementation. Will conflict with NKUA! yes this is ok.
13
 * 
14
 * @author marko
15
 * 
16
 */
17
public class HostingContextManagerServiceImpl extends AbstractBaseService implements HostingContextManagerService {
18

  
19
	/**
20
	 * logger.
21
	 */
22
	private static final Log log = LogFactory.getLog(HostingContextManagerServiceImpl.class); // NOPMD by marko on 11/24/08 5:02 PM
23

  
24
	/**
25
	 * notification handler.
26
	 */
27
	private NotificationHandler notificationHandler; // NOPMD
28

  
29
	@Override
30
	public void notify(String subscrId, String topic, String isId, String message) {
31
		if (log.isDebugEnabled()) {
32
			log.debug("---- service got notification ----");
33
			log.debug("subscrId: " + subscrId);
34
			log.debug("topic " + topic);
35
			log.debug("isId " + isId);
36
			log.debug("msg: " + message);
37
			log.debug("____ now processing the notification ____");
38
		}
39
		getNotificationHandler().notified(subscrId, topic, isId, message);
40
	}
41

  
42
	/**
43
	 * {@inheritDoc}
44
	 * 
45
	 * @see eu.dnetlib.enabling.tools.AbstractBaseService#start()
46
	 */
47
	@Override
48
	public void start() {
49
		log.info("staring hosting context manager");
50
	}
51

  
52
	public NotificationHandler getNotificationHandler() {
53
		return notificationHandler;
54
	}
55

  
56
	@Required
57
	public void setNotificationHandler(NotificationHandler notificationHandler) {
58
		this.notificationHandler = notificationHandler;
59
	}
60

  
61
}
modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/src/main/resources/eu/dnetlib/enabling/hcm/applicationContext-hcm.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
	xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
5
	xmlns:util="http://www.springframework.org/schema/util" xmlns:template="http://dnetlib.eu/springbeans/template"
6
	xmlns:t="http://dnetlib.eu/springbeans/t"
7
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
8
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
9
		http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
10
		http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd
11
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
12
	
13
	<!--  beans -->
14
	
15
	<bean id="hcmService"
16
		class="eu.dnetlib.enabling.hcm.HostingContextManagerServiceImpl"
17
		init-method="start" destroy-method="stop"  
18
		p:notificationHandler-ref="hcmNotificationHandler"/>
19
		
20
	<bean id="hcmNotificationHandler" class="eu.dnetlib.enabling.tools.blackboard.NotificationHandlerChainImpl"
21
		p:handlers-ref="dynamicSubscriptionActions">
22
		<property name="handlerExecutor">
23
			<bean class="org.springframework.core.task.SyncTaskExecutor" />
24
		</property>
25
	</bean>
26
	
27
	<bean id="dynamicSubscriptionActions"
28
		class="eu.dnetlib.enabling.hcm.sn.HCMSubscriptionListFactory" />
29
		
30
	<bean id="hcmSubscriber" class="eu.dnetlib.enabling.hcm.sn.HCMSubscriberImpl"
31
		p:endpoint-ref="hcmServiceEndpoint" p:serviceLocator-ref="uniqueServiceLocator" 
32
		p:actions-ref="dynamicSubscriptionActions" />
33
 		
34
	<bean t:id="hcmJobSchedulerAccessor"
35
		class="org.springframework.scheduling.quartz.SchedulerAccessorBean"
36
		p:scheduler-ref="jobScheduler">
37
		<property name="triggers">
38
			<list>
39
				<bean id="hcmSubscriptionTrigger"
40
					class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"
41
					p:startDelay="6000" p:repeatCount="0">
42
					<property name="jobDetail">
43
						<bean id="hcmSubscriptionJobDetails"
44
							class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"
45
							p:targetObject-ref="hcmSubscriber" p:targetMethod="subscribeAll" />
46
					</property>
47
				</bean>
48
			</list>
49
		</property>
50
	</bean>				
51

  
52
	<!-- endpoints -->
53
	<jaxws:endpoint id="hcmServiceEndpoint" implementor="#hcmService"
54
		implementorClass="eu.dnetlib.enabling.hcm.rmi.HostingContextManagerService"
55
		address="/hcm" />
56

  
57
	<template:instance name="serviceRegistrationManager"
58
		t:serviceRegistrationManagerClass="eu.dnetlib.enabling.tools.registration.ValidatingServiceRegistrationManagerImpl"
59
		t:name="hcmServiceRegistrationManager" t:service="hcmService"
60
		t:endpoint="hcmServiceEndpoint" t:jobScheduler="jobScheduler" />
61
</beans>
modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1/pom.xml
1
<?xml version="1.0" ?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<parent>
4
		<groupId>eu.dnetlib</groupId>
5
		<artifactId>dnet45-parent</artifactId>
6
		<version>1.0.0</version>
7
		<relativePath />
8
	</parent>
9
	<modelVersion>4.0.0</modelVersion>
10
	<groupId>eu.dnetlib</groupId>
11
	<artifactId>cnr-enabling-hcm-service</artifactId>
12
	<packaging>jar</packaging>
13
	<version>2.0.1</version>
14
	<scm>
15
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/cnr-enabling-hcm-service/tags/cnr-enabling-hcm-service-2.0.1</developerConnection>
16
	</scm>
17
	<dependencies>
18
		<dependency>
19
			<groupId>eu.dnetlib</groupId>
20
			<artifactId>cnr-notifications-common</artifactId>
21
			<version>[2.0.0, 3.0.0)</version>
22
		</dependency>
23
	</dependencies>
24
</project>

Also available in: Unified diff