Skip to content
Snippets Groups Projects
Commit 0a2b76c6 authored by buczekp's avatar buczekp
Browse files

[LMS-1818] introduced dummy evaluator

SVN: 18371
parent 0479622d
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2008 ETH Zuerich, CISD
*
* Licensed 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.
*/
package ch.systemsx.cisd.openbis.generic.server.dataaccess.db.dynamic_property;
import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import ch.systemsx.cisd.common.logging.LogCategory;
import ch.systemsx.cisd.common.logging.LogFactory;
/**
* @author Piotr Buczek
*/
public final class DummyDynamicPropertyEvaluationRunnable extends HibernateDaoSupport implements
IDynamicPropertyEvaluationScheduler, Runnable
{
private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION,
DummyDynamicPropertyEvaluationRunnable.class);
public DummyDynamicPropertyEvaluationRunnable(final SessionFactory sessionFactory)
{
setSessionFactory(sessionFactory);
operationLog.debug("dummy property evaluator created");
}
public void clear()
{
operationLog.debug("clear");
}
public void scheduleUpdate(DynamicPropertyEvaluationOperation operation)
{
operationLog.debug("scheduling " + operation);
}
//
// Runnable
//
public final void run()
{
operationLog.debug("started");
}
}
...@@ -36,6 +36,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.IEntityInformationWithPropert ...@@ -36,6 +36,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.IEntityInformationWithPropert
public final class DynamicPropertyEvaluationRunnable extends HibernateDaoSupport implements public final class DynamicPropertyEvaluationRunnable extends HibernateDaoSupport implements
IDynamicPropertyEvaluationScheduler, Runnable IDynamicPropertyEvaluationScheduler, Runnable
{ {
private static final int BATCH_SIZE = 1000; private static final int BATCH_SIZE = 1000;
public final static String DYNAMIC_PROPERTY_EVALUATOR_QUEUE_FILENAME = public final static String DYNAMIC_PROPERTY_EVALUATOR_QUEUE_FILENAME =
...@@ -114,10 +115,10 @@ public final class DynamicPropertyEvaluationRunnable extends HibernateDaoSupport ...@@ -114,10 +115,10 @@ public final class DynamicPropertyEvaluationRunnable extends HibernateDaoSupport
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public final void run() public final void run()
{ {
if (turnOff()) // if (turnOff())
{ // {
return; // return;
} // }
try try
{ {
while (true) while (true)
...@@ -169,8 +170,4 @@ public final class DynamicPropertyEvaluationRunnable extends HibernateDaoSupport ...@@ -169,8 +170,4 @@ public final class DynamicPropertyEvaluationRunnable extends HibernateDaoSupport
} }
} }
private static boolean turnOff()
{
return true;
}
} }
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
</bean> </bean>
<bean id="dynamic-property-evaluator" <bean id="dynamic-property-evaluator"
class="ch.systemsx.cisd.openbis.generic.server.dataaccess.db.dynamic_property.DynamicPropertyEvaluationRunnable"> class="ch.systemsx.cisd.openbis.generic.server.dataaccess.db.dynamic_property.DummyDynamicPropertyEvaluationRunnable">
<constructor-arg ref="hibernate-session-factory" /> <constructor-arg ref="hibernate-session-factory" />
</bean> </bean>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment