我使用的是WSO2Developer Studio版本3.8.0。我将编写Custom Task类以下是步骤:1。我创建了以下类
package com.training.mediators;
import org.apache.synapse.ManagedLifecycle;
import org.apache.synapse.core.SynapseEnvironment;
import org.apache.synapse.startup.Task;
@SuppressWarnings("deprecation")
public class CronjobTask implements Task,ManagedLifecycle{
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void init(SynapseEnvironment arg0) {
// TODO Auto-generated method stub
System.out.println("CronjobTask init method****************");
}
}
2. When i import the org.apache.synapse.startup.Task Developer studio shows that it is deprecated.
3. How can i implement the method execute() of the Task interface.If it is deprecated.
请指导我做错了什么。
答案 0 :(得分:0)
您的自定义任务应该实现org.apache.synapse.task.Task,而不是org.apache.synapse.startup.Task