Windchill Service方法实现
来源:互联网 发布:中山大学停止网络教育 编辑:程序博客网 时间:2024/06/01 17:39
Windchill 中的业务逻辑方法,可以让其运行在MethodServer上,9.1 版本的系统通过反射调用来实现在MethodServer上运行。10.0版本是通过java annotation实现。为什么会出现这样的方式调用方法呢?经过仔细分析,以及和PTC技术支持多次沟通,确定如下原因:
1 代码是跨越methodServer运行,要去访问缓存数据,或者数据库,那么就需要实现service方法。最典型的使用场景就是jsp中的java代码要查找windchill系统的数据,就需要使用service方法来跨越methodserver运行。
2 第二种典型使用场景就是,需要设置当前用户的用户名和密码等信息。
RemoteMethodServer rms = RemoteMethodServer.getDefault();rms.setUserName("");rms.setPassword("");现在来看看实现service方法的具体过程:
1 设计服务类的接口
import wt.method.RemoteInterface;import wt.part.WTPart;import wt.util.WTException;@RemoteInterfacepublic interface TrainingService {WTPart createFatherOf(final String name) throws WTException;}2 接口的实现
import wt.fc.PersistenceHelper;import wt.part.WTPart;import wt.services.StandardManager;import wt.util.WTException;import wt.util.WTPropertyVetoException;public class StandardTrainingService extends StandardManager implements TrainingService{private static final long serialVersionUID = 1L;public static StandardTrainingService newStandardTrainingService() throws WTException{final StandardTrainingService service = new StandardTrainingService();service.initialize();return service;}public WTPart createFatherOf(String name) throws WTException {final WTPart part = WTPart.newWTPart();try {part.setName("I am you father, "+name);} catch (WTPropertyVetoException e) {throw new WTException(e);}return (WTPart)PersistenceHelper.manager.store(part);}}
3 Helper类的实现
import wt.services.ServiceFactory;public class TrainingHelper {public static final TrainingService service = ServiceFactory.getService(TrainingService.class);}
- Windchill Service方法实现
- Windchill
- Windchill
- windchill开发之远程方法调用
- Windchill 二次开发中常用的API方法
- 动态编译,远端调用Windchill方法
- Windchill 中实现获取带有层级记录的BOM功能
- Web Service 中重载的实现方法
- 两种方法实现Web Service身份验证
- Android Bound Service实现方法详解
- android下实现service不死的方法
- 开发web service的接口实现方法
- Windchill常用命令
- windchill刻制中 代码中实现:HTTP遠程訪問鑒權,RMI遠程訪問鑒權,WebService客戶端測試訪問
- Windchill中实现like模糊查询字段中包含“_”和“%”的高级查询
- PDA端实现动态访问Web Service的方法
- Android 绑定Service的实现方法二:使用Messenger
- Servlet继承HttpServlet重写service方法的实现!
- 高性能网络服务器简介
- Python开发环境的搭建和相关的开发工具
- 享受寂寞
- 顺序存储结构(线性表)
- java学习技巧/心得
- Windchill Service方法实现
- Perl基本语法
- 关于对事件驱动架构(event drive architecture)和事件驱动编程的理解。
- 互联网中的伤痛如何来应对
- java ---- image单图片输出 和 动画输出
- GetCommandLine 获取当前进程的命令行字符串 对字符串进行分割
- 存储区
- struts2单文件与多文件上传
- struts2学习dem003_通配符映射