NC65获取Token以及相关信息
private static void setToken() {
IPriviledgedGenerator tokenGenerator = (IPriviledgedGenerator)
BusinessAppServer.getInstance().getContext().lookup("priviledgedTokenGenerator");
byte[] bytes = tokenGenerator.genPriviledgedToken();
NetStreamContext.setToken(bytes);
}
private void loginAsDefault() {
setToken();
if (StringUtils.isBlank(InvocationInfoProxy.getInstance().getGroupId())) {
InvocationInfoProxy.getInstance().setGroupId(IOrgConst.GLOBEORG);
InvocationInfoProxy.getInstance().setGroupNumber("1001");
InvocationInfoProxy.getInstance().setRunAs(UserExit.DEFAULT_USERID_VALUE);
InvocationInfoProxy.getInstance().setUserCode(UserExit.DEFAULT_USERID_VALUE);
InvocationInfoProxy.getInstance().setUserDataSource("design");
}
}
/**
* 获取泛型的Collection Type
* @param collectionClass 泛型的Collection
* @return JavaType Java类型
* @since 1.0
*/
public static JavaType getCollectionType(Class<?> collectionClass, Class<?>... elementClasses) {
return objectmapper.getTypeFactory().constructParametricType(collectionClass, elementClasses);
}
编程之路,永无止境