blob: f0fc89c4e5981c2997371d20dad5510f90dbdf7d [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task" xmlns:util="http://www.springframework.org/schema/util"
default-lazy-init="false"
xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="webapp" class="org.taverna.server.master.TavernaServer">
<property name="policy" ref="worker.policy" />
<property name="runStore" ref="worker.rundb" />
<property name="fileUtils" ref="fileUtils" />
<property name="contentsDescriptorBuilder" ref="contentsDescriptorBuilder" />
<property name="notificationEngine" ref="notificationFabric" />
<property name="support" ref="webapp.support" />
<property name="eventSource" ref="dispatch.atom" />
<property name="interactionFeed" value="${taverna.interaction.feed_path}" />
<lookup-method name="makeRunInterface" bean="run.coreView.prototype" />
<lookup-method name="getPolicyDescription" bean="webapp.policyView" />
</bean>
<bean id="webapp.support" class="org.taverna.server.master.TavernaServerSupport">
<property name="policy" ref="worker.policy" />
<property name="listenerFactory" ref="localworker.factory" />
<property name="runFactory" ref="localworker.factory" />
<property name="fileUtils" ref="fileUtils" />
<property name="runStore" ref="worker.rundb" />
<property name="stateModel" ref="webapp.state" />
<property name="idMapper" ref="IdentityMapper" />
<property name="invocationCounter" ref="webapp.invocationCounter" />
<property name="webapp" ref="webapp" />
<property name="contentTypeMap">
<map key-type="java.lang.String" value-type="java.lang.String">
<description>Maps suffixes (post '.') to content types.</description>
<entry key="baclava" value="application/vnd.taverna.baclava+xml" />
<entry key="robundle.zip" value="application/vnd.wf4ever.robundle+zip" />
</map>
</property>
<property name="capabilitySource" ref="capabilities" />
</bean>
<bean id="capabilities" class="org.taverna.server.master.utils.CapabilityLister" />
<bean id="webapp.policyView" class="org.taverna.server.master.PolicyREST">
<property name="support" ref="webapp.support" />
<property name="policy" ref="worker.policy" />
<property name="listenerFactory" ref="localworker.factory" />
<property name="notificationEngine" ref="notificationFabric" />
</bean>
<bean id="contentsDescriptorBuilder" class="org.taverna.server.master.ContentsDescriptorBuilder">
<property name="uriBuilderFactory" ref="webapp" />
<property name="fileUtils" ref="fileUtils" />
</bean>
<bean id="webapp.state" class="org.taverna.server.master.ManagementState">
<description>The initial state of the webapp.</description>
<property name="logIncomingWorkflows" value="${default.logworkflows}" />
<property name="allowNewWorkflowRuns" value="${default.permitsubmit}" />
<property name="logOutgoingExceptions" value="${default.logexceptions}" />
<property name="persistenceManagerBuilder" ref="pmb" />
<property name="self" ref="webapp.state" />
</bean>
<bean id="webapp.invocationCounter" class="org.taverna.server.master.utils.InvocationCounter" />
<bean id="webapp.perfLogger" class="org.taverna.server.master.utils.CallTimeLogger">
<property name="threshold" value="${calltime.logthreshold:4000000}" />
</bean>
<bean id="run.coreView.prototype" scope="prototype"
class="org.taverna.server.master.RunREST">
<property name="support" ref="webapp.support" />
<property name="cdBuilder" ref="contentsDescriptorBuilder" />
<lookup-method name="makeSecurityInterface" bean="run.securityView.prototype" />
<lookup-method name="makeInputInterface" bean="run.inputView.prototype" />
<lookup-method name="makeListenersInterface" bean="run.listenersView.prototype" />
<lookup-method name="makeDirectoryInterface" bean="run.directoryView.prototype" />
<lookup-method name="makeInteractionFeed" bean="run.interactionFeed.prototype" />
</bean>
<bean id="run.directoryView.prototype" scope="prototype"
class="org.taverna.server.master.DirectoryREST">
<property name="support" ref="webapp.support" />
<property name="fileUtils" ref="fileUtils" />
</bean>
<bean id="run.listenersView.prototype" scope="prototype"
class="org.taverna.server.master.ListenersREST">
<property name="support" ref="webapp.support" />
<lookup-method name="makeListenerInterface" bean="run.singleListenerView.prototype" />
</bean>
<bean id="run.singleListenerView.prototype" scope="prototype"
class="org.taverna.server.master.SingleListenerREST">
<lookup-method name="makePropertyInterface" bean="run.propertyView.prototype" />
</bean>
<bean id="run.propertyView.prototype" scope="prototype"
class="org.taverna.server.master.ListenerPropertyREST">
<property name="support" ref="webapp.support" />
</bean>
<bean id="run.inputView.prototype" scope="prototype"
class="org.taverna.server.master.InputREST">
<property name="support" ref="webapp.support" />
<property name="cdBuilder" ref="contentsDescriptorBuilder" />
<property name="fileUtils" ref="fileUtils" />
</bean>
<bean id="run.securityView.prototype" scope="prototype"
class="org.taverna.server.master.RunSecurityREST">
<property name="support" ref="webapp.support" />
</bean>
<bean id="run.interactionFeed.prototype" scope="prototype"
class="org.taverna.server.master.InteractionFeed">
<property name="interactionFeedSupport" ref="interactionFeed" />
</bean>
<bean id="feed" class="org.taverna.server.master.notification.atom.AtomFeed">
<property name="eventSource" ref="dispatch.atom" />
<property name="support" ref="webapp.support" />
<property name="feedLanguage" value="${atom.language}" />
<property name="abdera" ref="abdera" />
</bean>
<bean id="admin" class="org.taverna.server.master.admin.AdminBean">
<property name="adminHtmlFile" value="/admin.html" />
<property name="counter" ref="webapp.invocationCounter" />
<property name="factory" ref="localworker.factory" />
<property name="localWorkerModel" ref="localworker.state" />
<property name="runDB" ref="worker.rundb" />
<property name="state" ref="webapp.state" />
<property name="usageRecords" ref="usageRecordSink" />
<property name="userStore" ref="userStore" />
</bean>
<bean id="IdentityMapper" class="org.taverna.server.master.identity.CompositeIDMapper">
<property name="identityMappers">
<list>
<bean id="AuthorityBased"
class="org.taverna.server.master.identity.AuthorityDerivedIDMapper">
<description>Derives the local user identity to use for execution
from the LOCALUSER_* Spring Security authority. Thus, if the user
has &quot;LOCALUSER_foo&quot;, they will be executing as the local
user id &quot;foo&quot;.</description>
</bean>
<bean id="SelfAccess"
class="org.taverna.server.master.identity.WorkflowInternalAuthProvider.WorkflowSelfIDMapper">
<description>Handles the case where a workflow is accessing itself for
the purpose of publishing interactions.</description>
<property name="runStore" ref="worker.rundb" />
</bean>
<bean id="Extracting" class="org.taverna.server.master.identity.NameIDMapper">
<description>An alternate mechanism for mapping users. This tries
to use an RE to extract the user name from the principal name.
</description>
<property name="regexp" value="${localusernameregexp}">
<description>An optional regexp to extract the local user name
from the principal's string description. The first capturing
group will be the result of the mapping operation.
</description>
</property>
</bean>
<bean id="Constant" class="org.taverna.server.master.identity.ConstantIDMapper">
<description>How to map web principals to local users. This one
maps everyone to the same user, "taverna".
</description>
<property name="constantId" value="${default.localusername}" />
</bean>
</list>
</property>
</bean>
<bean id="passwordEncoder"
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" />
<bean class="org.taverna.server.master.identity.UserStore" id="userStore">
<property name="persistenceManagerBuilder" ref="pmb" />
<property name="baselineUserProperties">
<util:properties location="/WEB-INF/security/users.properties" />
</property>
<property name="defaultLocalUser" value="${default.localusername}" />
<property name="encoder" ref="passwordEncoder" />
</bean>
<!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" /> <property name="hibernateProperties">
<props> <prop key="hibernate.dialect">org.hibernate.dialect.DerbyDialect</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop> </props> </property> <property
name="annotatedClasses"> <list> </list> </property> </bean> -->
<bean id="pmb" class="org.taverna.server.master.utils.JDOSupport.PersistenceManagerBuilder">
<property name="persistenceManagerFactory">
<bean id="pmf" class="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"
destroy-method="close">
<property name="connectionFactory" ref="dataSource" />
<property name="nontransactionalRead" value="true" />
<property name="persistenceProperties">
<props>
<prop key="datanucleus.storeManagerType">rdbms</prop>
<prop key="datanucleus.autoCreateTables">true</prop>
<prop key="datanucleus.autoCreateTables">true</prop>
<prop key="datanucleus.validateTables">true</prop>
<prop key="datanucleus.autoCreateColumns">true</prop>
<prop key="datanucleus.autoCreateConstraints">true</prop>
<prop key="datanucleus.validateConstraints">true</prop>
<prop key="datanucleus.autoCreateSchema">true</prop>
<prop key="datanucleus.PersistenceUnitName">TavernaServer</prop>
<prop key="datanucleus.rdbms.datastoreAdapterClassName"
>org.taverna.server.master.utils.LoggingDerbyAdapter</prop>
</props>
</property>
</bean>
</property>
</bean>
<bean id="transactionAspect"
class="org.taverna.server.master.utils.JDOSupport.TransactionAspect" />
<bean id="systemPrereqs" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<description>http://stackoverflow.com/questions/3339736/set-system-property-with-spring-configuration-file</description>
<property name="targetObject" value="#{@systemProperties}" />
<property name="targetMethod" value="putAll" />
<property name="arguments">
<util:properties>
<prop key="derby.stream.error.field">org.taverna.server.master.utils.DerbyUtils.TO_LOG</prop>
<prop key="derby.stream.error.logSeverityLevel">30000</prop>
</util:properties>
</property>
</bean>
<!-- TODO: control the location of the database properly, or move to JNDI
TODO: review whether what we are doing now is correct! -->
<bean id="dataSource" class="org.taverna.server.master.utils.WebappAwareDataSource">
<property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="url"
value="jdbc:derby:directory:%{WEBAPPROOT}tavernaserver;create=true" />
<!-- Needed for Derby... -->
<property name="shutdownUrl"
value="jdbc:derby:directory:%{WEBAPPROOT}tavernaserver;shutdown=true" />
<property name="username" value="taverna" />
<property name="password" value="" />
<property name="contextualizer" ref="contextualizer" />
</bean>
<bean id="contextualizer" class="org.taverna.server.master.utils.Contextualizer" />
<bean id="usageRecordSink" class="org.taverna.server.master.usage.UsageRecordRecorder">
<property name="state" ref="webapp.state" />
<property name="contextualizer" ref="contextualizer" />
<property name="persistenceManagerBuilder" ref="pmb" />
<property name="self" ref="usageRecordSink" />
<property name="disableDB" value="${usage.disableDB}" />
<property name="logFile" value="${usage.logFile}" />
</bean>
<context:property-placeholder
ignore-unresolvable="true" order="2" properties-ref="default-factory-properties" />
<util:properties id="default-factory-properties">
<prop key="backEndFactory">org.taverna.server.master.localworker.IdAwareForkRunFactory</prop>
</util:properties>
<!-- This bean configuration replaced with org.taverna.server.master.localworker.LocalWorkerFactory -->
<!-- <bean id="localworker.factory" scope="singleton" lazy-init="false"
class="${backEndFactory}"> <description> The simple policy manager and factory
for the baseline localworker case. </description> <property name="state"
ref="localworker.state" /> <property name="runDB" ref="worker.rundb"
/> -->
<!-- Handled by autowiring to make type-resilient. -->
<!-- <property name="idMapper" ref="IdentityMapper" /> -->
<!-- <property name="securityContextFactory" ref="worker.securityContext"
/> <property name="usageRecordSink" ref="usageRecordSink" /> <property name="URProcessorPool"
ref="URThreads" /> </bean> -->
<!-- <task:executor id="URThreads" pool-size="${pool.size}" /> -->
<bean id="worker.securityContext"
class="org.taverna.server.master.worker.SecurityContextFactory">
<property name="runDatabase" ref="worker.rundb" />
<property name="filenameConverter" ref="fileUtils" />
<property name="x500Utils" ref="x500Utils" />
<property name="httpRealm" value="${http.realmName}" />
<property name="uriSource" ref="webapp" />
<property name="certificateFetcher" ref="certificateChainFetcher" />
<property name="passwordIssuer" ref="passwordIssuer" />
</bean>
<bean id="passwordIssuer" class="org.taverna.server.master.worker.PasswordIssuer">
<!-- <property name="length" value="8" /> -->
</bean>
<bean id="certificateChainFetcher" class="org.taverna.server.master.utils.CertificateChainFetcher">
<property name="secure" value="${fetchCertificateChain}" />
</bean>
<bean id="localworker.state" class="org.taverna.server.master.localworker.LocalWorkerState"
scope="singleton" lazy-init="false">
<description>
The state of the simple factory for the identity-aware
local worker.
</description>
<property name="defaultLifetime" value="${default.lifetime}">
<description>How long the run lasts for by default, in seconds.
</description>
</property>
<property name="maxRuns" value="${default.runlimit}">
<description>The maximum simultaneous number of runs.</description>
</property>
<property name="operatingLimit" value="${default.operatinglimit}">
<description>
The maximum number of runs that are in the Operating state,
i.e., actually running with a process consuming resources.
</description>
</property>
<property name="extraArgs">
<description>Any extra arguments (memory control, etc.) to pass to
the spawned subprocesses.
</description>
<list>
</list>
</property>
<property name="waitSeconds" value="40">
<description>An upper bound (in seconds) on the time to wait for a
subprocess to start before failing it.
</description>
</property>
<property name="sleepMS" value="1000">
<description>The time to wait (in milliseconds) between polling for
the subprocess to complete its registration.
</description>
</property>
<property name="persistenceManagerBuilder" ref="pmb" />
<!-- <property name="javaBinary"> <description>The name of the java executable
used to run the server worker. Defaults to the executable used to run the
hosting environment.</description> </property> -->
<!-- <property name="serverWorkerJar"> <description>The full path to the
executable JAR file containing the implementation of the server worker.</description>
</property> -->
<!-- <property name="executeWorkflowScript"> <description>The full path
to the executeworkflow.sh in either the Taverna 2 Workbench distribution
or the Taverna 2 Command Line distribution.</description> </property> -->
<property name="self" ref="localworker.state" />
<property name="defaultExecuteWorkflowScript" value="${executeWorkflowScript:NONE}" />
</bean>
<bean id="worker.policy" class="org.taverna.server.master.worker.PolicyImpl">
<description>
The implementation of the access control policy supported
by the localworker run engine.
</description>
<property name="limits" ref="localworker.state" />
<property name="runDB" ref="worker.rundb" />
</bean>
<bean id="worker.rundb" class="org.taverna.server.master.worker.RunDatabase">
<property name="notifier" ref="worker.notifier" />
<property name="typeNotifiers">
<list>
<ref bean="cn.email" />
<ref bean="cn.sms" />
<ref bean="cn.twitter" />
<!-- <ref bean="cn.xmpp"/> -->
</list>
</property>
<property name="notificationEngine" ref="notificationFabric" />
<property name="dao" ref="worker.runDAO" />
</bean>
<bean id="cn.email"
class="org.taverna.server.master.worker.VelocityCompletionNotifier">
<property name="name" value="email" />
<property name="subject" value="Workflow run finished executing" />
<property name="velocityEngine" ref="velocity" />
<property name="uriBuilderFactory" ref="webapp" />
</bean>
<bean id="cn.sms"
class="org.taverna.server.master.worker.VelocityCompletionNotifier">
<property name="name" value="sms" />
<property name="subject" value="Run finished" />
<property name="velocityEngine" ref="velocity" />
<property name="uriBuilderFactory" ref="webapp" />
</bean>
<bean id="cn.twitter"
class="org.taverna.server.master.worker.VelocityCompletionNotifier">
<property name="name" value="twitter" />
<property name="subject" value="Run finished" />
<property name="velocityEngine" ref="velocity" />
<property name="uriBuilderFactory" ref="webapp" />
</bean>
<bean id="worker.runDAO" class="org.taverna.server.master.worker.RunDatabaseDAO">
<description>
The implementation of the catalog of workflow runs
supported by the localworker run engine.
</description>
<property name="persistenceManagerBuilder" ref="pmb" />
<property name="facade" ref="worker.rundb" />
</bean>
<task:scheduled-tasks scheduler="taskScheduler">
<task:scheduled ref="worker.rundb" method="cleanNow"
fixed-delay="${purge.interval}" />
<task:scheduled ref="worker.rundb" method="checkForFinishNow"
fixed-delay="${finish.interval}" />
<task:scheduled ref="dispatch.atom" method="deleteExpiredEvents"
fixed-delay="${atom.cleaninterval}" />
</task:scheduled-tasks>
<bean id="notificationFabric"
class="org.taverna.server.master.notification.NotificationEngine">
<property name="dispatchers">
<list>
<ref bean="dispatch.email" />
<ref bean="dispatch.twitter" />
<ref bean="dispatch.xmpp" />
<ref bean="dispatch.sms" />
</list>
</property>
<property name="universalDispatchers">
<list>
<ref bean="dispatch.atom" />
</list>
</property>
</bean>
<bean id="dispatch.email" class="org.taverna.server.master.notification.EmailDispatcher">
<property name="from" value="${email.from}" />
<property name="messageContentType" value="${email.type}" />
<property name="cooldownSeconds" value="${message.cooldown}" />
<property name="smtpHost" value="${email.host}" />
<property name="sender">
<bean class="org.springframework.mail.javamail.JavaMailSenderImpl"
id="javamail">
<property name="host" value="${email.host}" />
</bean>
</property>
</bean>
<bean id="dispatch.twitter"
class="org.taverna.server.master.notification.TwitterDispatcher">
<property name="cooldownSeconds" value="${message.cooldown}" />
<property name="accessToken" value="${twitter.oauth.accessToken}" />
<property name="accessSecret" value="${twitter.oauth.accessTokenSecret}" />
</bean>
<bean id="dispatch.xmpp" class="org.taverna.server.master.notification.JabberDispatcher">
<property name="resource" value="${xmpp.resource}" />
<property name="host" value="${xmpp.service}" />
<property name="username" value="${xmpp.user}" />
<property name="password" value="${xmpp.password}" />
</bean>
<bean id="dispatch.sms" class="org.taverna.server.master.notification.SMSDispatcher">
<property name="usernameField" value="${sms.userfield}" />
<property name="passwordField" value="${sms.passfield}" />
<property name="destinationField" value="${sms.destfield}" />
<property name="messageField" value="${sms.msgfield}" />
<property name="cooldownSeconds" value="${message.cooldown}" />
</bean>
<bean id="dispatch.atom" class="org.taverna.server.master.notification.atom.EventDAO">
<property name="expiryAgeDays" value="${atom.lifespan}" />
<property name="persistenceManagerBuilder" ref="pmb" />
<property name="uriBuilderFactory" ref="feed" />
<property name="self" ref="dispatch.atom" />
</bean>
<bean id="worker.notifier"
class="org.taverna.server.master.worker.SimpleFormattedCompletionNotifier">
<property name="subject" value="${message.termination.subject}" />
<property name="messageFormat" value="${message.termination.body}" />
<property name="name" value="fallback"/>
</bean>
<bean id="fileUtils" class="org.taverna.server.master.utils.FilenameUtils" />
<bean id="x500Utils" class="org.taverna.server.master.utils.X500Utils" />
<task:scheduler id="taskScheduler" pool-size="${pool.size}" />
<bean class="org.taverna.server.master.utils.JCECheck" id="JCECheck" />
<bean class="org.taverna.server.master.interaction.InteractionFeedSupport"
id="interactionFeed" scope="singleton">
<property name="abdera" ref="abdera" />
<property name="support" ref="webapp.support" />
<property name="uriBuilder" ref="webapp" />
<property name="utils" ref="fileUtils" />
</bean>
<bean class="org.taverna.server.master.rest.handler.FeedHandler" id="atomFeedHandler">
<property name="abdera" ref="abdera" />
</bean>
<bean class="org.taverna.server.master.rest.handler.EntryHandler" id="atomEntryHandler">
<property name="abdera" ref="abdera" />
</bean>
<bean id="authProvider" class="org.taverna.server.master.identity.StrippedDownAuthProvider">
<property name="passwordEncoder" ref="passwordEncoder" />
<property name="userDetailsService">
<bean class="org.taverna.server.master.identity.UserStore.CachedUserStore">
<property name="realStore" ref="userStore" />
</bean>
</property>
</bean>
<bean id="workflowInternalAuthProvder"
class="org.taverna.server.master.identity.WorkflowInternalAuthProvider">
<property name="dao" ref="worker.runDAO" />
<property name="cacheBound" value="${default.runlimit}" />
</bean>
<bean id="velocity" class="org.apache.velocity.app.VelocityEngine"
init-method="init" lazy-init="false">
<constructor-arg>
<props>
<prop key="input.encoding">UTF-8</prop>
<prop key="output.encoding">UTF-8</prop>
<prop key="runtime.log.logsystem.class">org.apache.velocity.runtime.log.Log4JLogChute</prop>
<prop key="runtime.log.logsystem.log4j.logger">org.taverna.server.master.worker.VelocityCompletionNotifier</prop>
<prop key="resource.loader">class</prop>
<prop key="class.resource.loader.description">Velocity Classpath Resource Loader</prop>
<prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</prop>
</props>
</constructor-arg>
</bean>
<bean id="abdera" class="org.apache.abdera.Abdera"/>
</beans>