[jbpm-commits] JBoss JBPM SVN: r6120 - in projects/businesslink/src: main/java/org/jbpm/businesslink/internal/svc and 3 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jan 22 06:50:24 EST 2010
Author: tom.baeyens at jboss.com
Date: 2010-01-22 06:50:24 -0500 (Fri, 22 Jan 2010)
New Revision: 6120
Added:
projects/businesslink/src/main/java/org/jbpm/businesslink/internal/svc/BusinessLinkSessionImpl.java
projects/businesslink/src/main/resources/
projects/businesslink/src/main/resources/jbpm.businesslink.cfg.xml
projects/businesslink/src/test/resources/
projects/businesslink/src/test/resources/hibernate.cfg.xml
projects/businesslink/src/test/resources/logging.properties
Log:
adding persistence
Added: projects/businesslink/src/main/java/org/jbpm/businesslink/internal/svc/BusinessLinkSessionImpl.java
===================================================================
--- projects/businesslink/src/main/java/org/jbpm/businesslink/internal/svc/BusinessLinkSessionImpl.java (rev 0)
+++ projects/businesslink/src/main/java/org/jbpm/businesslink/internal/svc/BusinessLinkSessionImpl.java 2010-01-22 11:50:24 UTC (rev 6120)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.businesslink.internal.svc;
+
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.Session;
+import org.jbpm.businesslink.api.Artifact;
+import org.jbpm.businesslink.api.BusinessLinkSession;
+import org.jbpm.businesslink.api.Link;
+import org.jbpm.businesslink.internal.spi.Repository;
+import org.jbpm.businesslink.test.BusinessLinkSessionFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class BusinessLinkSessionImpl implements BusinessLinkSession {
+
+ protected Map<String, Repository> repositories;
+ protected Session session;
+
+ public BusinessLinkSessionImpl(){
+ }
+
+ public BusinessLinkSessionImpl(BusinessLinkSessionFactory businessLinkSessionFactory) {
+ this.repositories = businessLinkSessionFactory.getRepositories();
+ this.session = businessLinkSessionFactory.getSessionFactory().openSession();
+ }
+
+ public List<Artifact> getArtifacts(String directoryPath) {
+ int slashIndex = directoryPath.indexOf('/');
+ if (slashIndex==-1) {
+ throw new RuntimeException("invalid directory path: no slash: "+directoryPath);
+ }
+ String repositoryName = directoryPath.substring(0, slashIndex);
+ Repository repository = repositories.get(repositoryName);
+
+ String repoPath = directoryPath.substring(slashIndex+1);
+ return repository.getArtifacts(repoPath);
+ }
+
+
+ public Link createLink(String artifactA, String artifactB) {
+ return null;
+ }
+
+ public Link deleteLink(Link link) {
+ return null;
+ }
+
+ public List<Link> getLinks(String path) {
+ return null;
+ }
+
+ public void updateLink(Link link) {
+ }
+}
Property changes on: projects/businesslink/src/main/java/org/jbpm/businesslink/internal/svc/BusinessLinkSessionImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: projects/businesslink/src/main/resources/jbpm.businesslink.cfg.xml
===================================================================
--- projects/businesslink/src/main/resources/jbpm.businesslink.cfg.xml (rev 0)
+++ projects/businesslink/src/main/resources/jbpm.businesslink.cfg.xml 2010-01-22 11:50:24 UTC (rev 6120)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <object class="org.jbpm.businesslink.internal.svc.BusinessLinkServiceImpl">
+ <field name="commandService"><ref type="org.jbpm.pvm.internal.cmd.CommandService" /></field>
+ <invoke method="addRepository">
+ <arg>
+ <object class="org.jbpm.businesslink.internal.file.FileRepository">
+ <constructor>
+ <arg><string value="test-sources" /></arg>
+ <arg><string value="src/test/java" /></arg>
+ </constructor>
+ </object>
+ </arg>
+ </invoke>
+ </object>
+
+ </process-engine-context>
+
+</jbpm-configuration>
Property changes on: projects/businesslink/src/main/resources/jbpm.businesslink.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: projects/businesslink/src/test/resources/hibernate.cfg.xml
===================================================================
--- projects/businesslink/src/test/resources/hibernate.cfg.xml (rev 0)
+++ projects/businesslink/src/test/resources/hibernate.cfg.xml 2010-01-22 11:50:24 UTC (rev 6120)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property name="hibernate.format_sql">true</property>
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: projects/businesslink/src/test/resources/hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: projects/businesslink/src/test/resources/logging.properties
===================================================================
--- projects/businesslink/src/test/resources/logging.properties (rev 0)
+++ projects/businesslink/src/test/resources/logging.properties 2010-01-22 11:50:24 UTC (rev 6120)
@@ -0,0 +1,18 @@
+handlers= java.util.logging.ConsoleHandler
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINEST
+java.util.logging.ConsoleHandler.formatter = org.jbpm.businesslink.internal.log.LogFormatter
+
+org.jbpm.level=FINE
+# org.jbpm.pvm.internal.tx.level=FINE
+# org.jbpm.pvm.internal.wire.level=FINE
+# org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.level=INFO
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+org.hibernate.cfg.HbmBinder.level=SEVERE
+org.hibernate.SQL.level=FINEST
+org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
\ No newline at end of file
Property changes on: projects/businesslink/src/test/resources/logging.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the jbpm-commits
mailing list