本文整理汇总了Java中com.ibm.xsp.application.ApplicationEx类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationEx类的具体用法?Java ApplicationEx怎么用?Java ApplicationEx使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationEx类属于com.ibm.xsp.application包,在下文中一共展示了ApplicationEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stopService
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
private void stopService(ApplicationEx app) {
if(app instanceof DesignerApplicationEx) {
com.ibm.designer.runtime.Application designerApp = ((DesignerApplicationEx)app).getDesignerApplication();
String appName = designerApp.getAppName();
if(servers.containsKey(appName)) {
GroovyShellService service = servers.remove(appName);
if(service != null) {
try {
if(log.isInfoEnabled()) {
log.info("{0}: Stopping Groovy shell in application '{1}'", GroovyShellLibrary.LIBRARY_ID, appName);
}
service.destroy();
} catch(IOException e) {
if(log.isErrorEnabled()) {
log.error(e, "{0}: Error stopping Groovy shell server for application '{1}'", GroovyShellLibrary.LIBRARY_ID, appName);
}
}
}
}
}
}
示例2: createServer
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
private GroovyShellService createServer(ApplicationEx app, int port) {
GroovyShellService service = new GroovyShellService();
service.setPort(port);
ClassLoader appClassLoader = getApplicationClassLoader(app);
ClassLoader cl = new DelegatingClassLoader(appClassLoader, getClass().getClassLoader());
service.setThreadFactory(new DominoGroovyThreadFactory(cl));
service.setClassLoader(cl);
service.setThreadInitCallback(() -> {
if(NotesContext.getCurrentUnchecked() == null) {
NotesContext context = new NotesContext(module);
NotesContext.initThread(context);
}
});
return service;
}
示例3: sessionDestroyed
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
@Override
public void sessionDestroyed(ApplicationEx app, HttpSessionEvent event) {
LOG.log(Level.INFO,"***sessionDestroyed***");
if(XSPUtils.context()!=null){
IWebSocketBean userMgr = (IWebSocketBean) XSPUtils.getBean(Const.WEBSOCKET_BEAN);
userMgr.removeCurrentUser();
}
//cleanup any stored session vars
LOG.log(Level.INFO, "removing sessiondata for " + event.getSession().getId());
Data.insta().remove(event.getSession().getId());
if(Config.getInstance().isCertAuth()){
System.out.println("Deleting sessionFile");
File sessionFile = new File("c:/sessions/" + event.getSession().getId() + ".txt");
if(sessionFile.exists()) sessionFile.delete();
}
}
示例4: init
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
@Override
@Inject
public void init(IDominoWebSocketServer server){
if(isOn.compareAndSet(false, true)) {
this.server = server;
ApplicationEx appEx = (ApplicationEx) XSPUtils.app();
//add the listeners
appEx.addApplicationListener(new AppListener());
appEx.addSessionListener(new SocketSessionListener());
//catch the very first user.
try {
this.registerCurrentUser();
} catch (NotesException e) {
LOG.log(Level.SEVERE,null,e);
}
}
}
示例5: service
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
// Create a temporary FacesContext and make it available
FacesContext context = initContext(servletRequest, servletResponse);
ApplicationEx app = ((FacesContextEx)context).getApplicationEx();
if(app.getController() == null){
HttpServletResponse resp=(HttpServletResponse)servletResponse;
resp.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
resp.setContentType("text/html"); //$NON-NLS-1$
resp.setCharacterEncoding("UTF-8"); //$NON-NLS-1$
PrintWriter w = new PrintWriter(new OutputStreamWriter(resp.getOutputStream(),"utf-8")); //$NON-NLS-1$
// TODO SPR# PHAN9B6BC6 uncomment next line to provide proper error message
// String errMsg = "The server session has expired. Please reload the main page to start a new session"; // $NLS-XspYaddaYadda-1$
// TODO remove this string as it is being used temporarily to fix a problem arising after string translation deadline
w.println(ResourceHandler.getString("DominoUtils.SessionNotAvailable")); //$NON-NLS-1$
w.flush();
return;
}
try {
// Do whatever you need
super.service(servletRequest, servletResponse);
} finally {
releaseContext(context);
}
}
示例6: BBerryPageCustomizer
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
public BBerryPageCustomizer(FacesContext context, RequestParameters parameters) {
super(context, parameters);
// WARN: we cannot read the property from FacesContext as goes to
// infinite
// recursion, because FacesContext also relies on the request parameters
// -> we directly read the property from the application object, which
// can be then set at either the application or server level.
ApplicationEx app = ApplicationEx.getInstance(context);
String s = app.getApplicationProperty(MobileConstants.XSP_THEME_MOBILE_BBERRY, null);
if (StringUtil.isNotEmpty(s)) {
parameters.setProperty(MobileConstants.XSP_THEME_WEB, s);
}
else {
s = app.getApplicationProperty(MobileConstants.XSP_THEME_MOBILE, BBerryConstants.BBERRY_THEME_NAME);
parameters.setProperty(MobileConstants.XSP_THEME_WEB, s);
}
}
示例7: isMobilePage
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
private boolean isMobilePage(FacesContext context) {
ExternalContext o = context.getExternalContext();
HttpServletRequest r = (javax.servlet.http.HttpServletRequest) o.getRequest();
String path = r.getServletPath();
ApplicationEx app = ApplicationEx.getInstance(context);
String prefix = app.getApplicationProperty(MobileConstants.XSP_THEME_MOBILE_PAGEPREFIX, null);
if (prefix == null) {
return false;
}
else if (prefix.equals("*")) { // $NON-NLS-1$
return true;
}
else {
return path.startsWith("/" + prefix); // $NON-NLS-1$
}
}
示例8: AndroidPageCustomizer
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
public AndroidPageCustomizer(FacesContext context, RequestParameters parameters) {
super(context, parameters);
// WARN: we cannot read the property from FacesContext as goes to
// infinite
// recursion, because FacesContext also relies on the request parameters
// -> we directly read the property from the application object, which
// can be then set at either the application or server level.
ApplicationEx app = ApplicationEx.getInstance(context);
String s = app.getApplicationProperty(MobileConstants.XSP_THEME_MOBILE_ANDROID, null);
if (StringUtil.isNotEmpty(s)) {
parameters.setProperty(MobileConstants.XSP_THEME_WEB, s);
}
else {
s = app.getApplicationProperty(MobileConstants.XSP_THEME_MOBILE, AndroidConstants.ANDROID_THEME_NAME);
parameters.setProperty(MobileConstants.XSP_THEME_WEB, s);
}
}
示例9: IPhonePageCustomizer
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
public IPhonePageCustomizer(FacesContext context, RequestParameters parameters) {
super(context, parameters);
// WARN: we cannot read the property from FacesContext as goes to
// infinite
// recursion, because FacesContext also relies on the request parameters
// -> we directly read the property from the application object, which
// can be then set at either the application or server level.
ApplicationEx app = ApplicationEx.getInstance(context);
String s = app.getApplicationProperty(MobileConstants.XSP_THEME_MOBILE_IPHONE, null);
if (StringUtil.isNotEmpty(s)) {
parameters.setProperty(MobileConstants.XSP_THEME_WEB, s);
}
else {
s = app.getApplicationProperty(MobileConstants.XSP_THEME_MOBILE, IPhoneConstants.IPHONE_THEME_NAME);
parameters.setProperty(MobileConstants.XSP_THEME_WEB, s);
}
}
示例10: cloneAttribute
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public static void cloneAttribute(UIComponent sourceComponent, UIComponent destinationComponent,
String propertyName, Class propertyType) {
_logger.finest("Cloning " + propertyType.getSimpleName() + " attribute " + propertyName + " from "
+ sourceComponent.getClass().getSimpleName() + " to " + destinationComponent.getClass().getSimpleName());
ValueBinding vb = sourceComponent.getValueBinding(propertyName);
Method getter = getGetter(sourceComponent, propertyName, propertyType);
Method setter = getSetter(destinationComponent, propertyName, propertyType);
if (vb == null) {
cloneAttributeValue(sourceComponent, destinationComponent, getter, setter);
} else {
_logger.finest("Cloning value binding " + vb.getExpressionString());
String expression = vb.getExpressionString();
if (ValueBindingUtil.isRuntimeExpression(expression)) {
ValueBinding destinationVb = ApplicationEx.getInstance().createValueBinding(expression);
destinationComponent.setValueBinding(propertyName, destinationVb);
} else {
cloneAttributeValue(sourceComponent, destinationComponent, getter, setter);
}
}
}
示例11: findActionHandler
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
protected IActionHandler findActionHandler(String actHandlerName){
try{
if(actHandlerName!=null && actHandlerName!=""){
List<IActionHandler> allHandlers = ApplicationEx.getInstance().findServices(IActionHandler.ACTION_HANDLER_SERVICE);
for(IActionHandler handler: allHandlers){
if(handler.getClass().getName().equalsIgnoreCase(actHandlerName)){
return handler;
}
}
}
}catch(Exception e){
e.printStackTrace();
}
return null;
}
示例12: createImplicitObjects
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
/**
* Creates the "cheap" objects
*/
@Override
public void createImplicitObjects(final FacesContextEx ctx) {
if (!implicitsDone_) {
implicitsDone_ = true;
if (!ODAPlatform.isAPIEnabled(null))
return;
Session session = Factory.getSession(SessionType.CURRENT);
Database db = session.getCurrentDatabase();
Map<String, Object> ecMap = TypedUtil.getRequestMap(ctx.getExternalContext());
ecMap.put("openSession", session);
ecMap.put("openDatabase", db);
// Attach NSA
if (ODAPlatform.isAppFlagSet("nsa")) {
Application app = ctx.getApplication();
if (app instanceof ApplicationEx) {
NSA.INSTANCE.registerApplication((ApplicationEx) app);
NSA.INSTANCE.registerSession((ApplicationEx) app, (HttpSession) ctx.getExternalContext().getSession(true));
}
}
}
}
示例13: getValueBinding
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
/**
* Create a value binding for {@link #getField(String)} and {@link #setField(String, ValueHolder)}
*
* @param variable
* the variableName, like <code>"document2.Form"</code>
* @return a {@link ValueBinding}
*/
protected ValueBinding getValueBinding(final String variable) {
ValueBinding ret = valueBindings.get(variable);
if (ret == null) {
ApplicationEx app = (ApplicationEx) context.getApplication();
ret = app.createValueBinding("#{" + variable + "}");
if ((ret instanceof ValueBindingEx)) {
ValueBindingEx valueEx = (ValueBindingEx) ret;
valueEx.setComponent(component);
valueEx.setSourceReferenceId(null); // TODO RPr: What to set here
valueEx.setExpectedType(Object.class);
} else if ((ret instanceof ComponentBindingObject)) {
((ComponentBindingObject) ret).setComponent(component);
}
valueBindings.put(variable, ret);
}
return ret;
}
示例14: cloneAttribute
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public static void cloneAttribute(final UIComponent sourceComponent, final UIComponent destinationComponent, final String propertyName, final Class propertyType) {
_logger.finest("Cloning " + propertyType.getSimpleName() + " attribute " + propertyName + " from "
+ sourceComponent.getClass().getSimpleName() + " to " + destinationComponent.getClass().getSimpleName());
ValueBinding vb = sourceComponent.getValueBinding(propertyName);
Method getter = getGetter(sourceComponent, propertyName, propertyType);
Method setter = getSetter(destinationComponent, propertyName, propertyType);
if (vb == null) {
cloneAttributeValue(sourceComponent, destinationComponent, getter, setter);
} else {
_logger.finest("Cloning value binding " + vb.getExpressionString());
String expression = vb.getExpressionString();
if (ValueBindingUtil.isRuntimeExpression(expression)) {
ValueBinding destinationVb = ApplicationEx.getInstance().createValueBinding(expression);
destinationComponent.setValueBinding(propertyName, destinationVb);
} else {
cloneAttributeValue(sourceComponent, destinationComponent, getter, setter);
}
}
}
示例15: applicationCreated
import com.ibm.xsp.application.ApplicationEx; //导入依赖的package包/类
@Override
public void applicationCreated(ApplicationEx app) {
if(usesLibrary(app)) {
startService(app);
NotesContext context = NotesContext.getCurrent();
module = context.getModule();
}
}