论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Satyanarayana kolliboyin
Upgradation : Liferay 6.1-EE -GA1 schedule() Liferay 6.1-EE -GA2 schedule()
2012年12月16日 下午11:42
答复

Satyanarayana kolliboyin

等级: New Member

帖子: 24

加入日期: 2010年6月23日

最近的帖子

In Liferay 6.1-EE-GA1 : SchedulerEngineUtil API
Method: schedule(SchedulerEntry schedulerEntry, StorageType storageType, ClassLoader classLoader, int exceptionsMaxSize)
Status: Deleted In Liferay 6.1-EE-GA2
New method: schedule(SchedulerEntry schedulerEntry, StorageType storageType, String portletId, int exceptionsMaxSize)
See: LPE-6536

Please suggest me how to use new method without change much code.

In Liferay 6.1-EE-GA1 : scheduler calling by using the below code :
-----------------------------------------------------------------------------------------
cSchedulerEntryInstance = new SchedulerEntryImpl();

cSchedulerEntryInstance.setDescription("LinkResolverConfigWatcher");
cSchedulerEntryInstance.setEventListener(new LinkResolverConfigWatcherJob());
cSchedulerEntryInstance.setTriggerType(TriggerType.SIMPLE);
int triggerValue = Integer.parseInt(HROPropertiesServiceUtil.getRefreshInterval());

// milliseconds to seconds.
// 1000 ms =1 sec
triggerValue = triggerValue / 1000;

cSchedulerEntryInstance.setTriggerValue(triggerValue);
cSchedulerEntryInstance
.setEventListenerClass("com.testpackage.LinkResolverConfigWatcherJob");
cSchedulerEntryInstance.setTimeUnit(TimeUnit.SECOND);


Thread thread = Thread.currentThread();
SchedulerEngineUtil.schedule(cSchedulerEntryInstance, StorageType.MEMORY, thread.getContextClassLoader(), 5);

---------------------------------------------------------------------------------------------------------

NOTE : If I pass portletId as one of the argument for new method then scheduler calling only first job. Its not calling other jobs.
Satyanarayana kolliboyin
RE: Upgradation : Liferay 6.1-EE -GA1 schedule() Liferay 6.1-EE -GA2 schedu
2012年12月18日 上午6:59
答复

Satyanarayana kolliboyin

等级: New Member

帖子: 24

加入日期: 2010年6月23日

最近的帖子

Sorry the problem is job or group name length is more than 80 characters. In liferay default job or group name length is 80.
So, we added the below entries in portal-ext.properties file. Its working fine.

scheduler.group.name.max.length=100
scheduler.job.name.max.length=100