本文整理汇总了Java中com.wm.app.b2b.server.Service.getSession方法的典型用法代码示例。如果您正苦于以下问题:Java Service.getSession方法的具体用法?Java Service.getSession怎么用?Java Service.getSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.wm.app.b2b.server.Service
的用法示例。
在下文中一共展示了Service.getSession方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: put_object_in_session
import com.wm.app.b2b.server.Service; //导入方法依赖的package包/类
public static final Values put_object_in_session (Values in)
{
Values out = in;
// --- <<IS-START(put_object_in_session)>> ---
// @sigtype java 3.0
// [i] object:0:required object
// [i] field:0:required objectName
Object obj = in.get("object");
String strObjectName = in.getString("objectName");
Session session = Service.getSession();
// Data type
Object tobj = session.get(strObjectName);
if (tobj != null)
session.remove(strObjectName);
session.put(strObjectName, obj);
// --- <<IS-END>> ---
return out;
}
示例2: getUser
import com.wm.app.b2b.server.Service; //导入方法依赖的package包/类
public static final void getUser (IData pipeline)
throws ServiceException
{
// --- <<IS-START(getUser)>> ---
// @sigtype java 3.5
// [o] field:0:required user_id
IDataHashCursor idc = pipeline.getHashCursor();
Session session = Service.getSession();
User user = session.getUser();
String user_id = user.getName();
idc.first();
idc.insertAfter("user_id",user_id);
// --- <<IS-END>> ---
}
示例3: get_object_from_session
import com.wm.app.b2b.server.Service; //导入方法依赖的package包/类
public static final Values get_object_from_session (Values in)
{
Values out = in;
// --- <<IS-START(get_object_from_session)>> ---
// @sigtype java 3.0
// [i] field:0:required objectName
// [o] object:0:required object
String strObjectName = in.getString("objectName");
Session session = Service.getSession();
out.put("object", session.get(strObjectName));
// --- <<IS-END>> ---
return out;
}
示例4: getUserGroup
import com.wm.app.b2b.server.Service; //导入方法依赖的package包/类
public static final void getUserGroup (IData pipeline)
throws ServiceException
{
// --- <<IS-START(getUserGroup)>> ---
// @sigtype java 3.5
// [i] field:0:required userid
// [o] field:1:required group_list
// [o] field:0:required userid
IDataHashCursor idc = pipeline.getHashCursor();
idc.first("userid");
String user_id = (String)idc.getValue();
Session session = Service.getSession();
User user = session.getUser();
if (user_id == null)
{
user_id = user.getName();
idc.first();
idc.insertAfter("userid",user_id);
}
String group_name = "";
Enumeration enum = user.membership();
int count = 0;
while(enum.hasMoreElements())
{
group_name = (String)enum.nextElement();
count++;
}
String group_array[] = new String[count];
enum = user.membership();
count = 0;
while(enum.hasMoreElements())
{
group_name = (String)enum.nextElement();
group_array[count] = group_name;
count++;
}
idc.first();
idc.insertAfter("group_list", group_array);
idc.destroy();
// --- <<IS-END>> ---
}
示例5: getCurrentSession
import com.wm.app.b2b.server.Service; //导入方法依赖的package包/类
/**
* Returns the current session.
*
* @return The current session.
*/
public static Session getCurrentSession() {
return Service.getSession();
}