當前位置: 首頁>>代碼示例>>Java>>正文


Java Application.get方法代碼示例

本文整理匯總了Java中org.apache.wicket.Application.get方法的典型用法代碼示例。如果您正苦於以下問題:Java Application.get方法的具體用法?Java Application.get怎麽用?Java Application.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.Application的用法示例。


在下文中一共展示了Application.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getWebSocketConnection

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static IWebSocketConnection getWebSocketConnection(WebSocketInfo wsinfo)
{
	IWebSocketConnection connection = null;

	if (wsinfo != null)
	{
		Application application = Application.get(wsinfo.getApplicationName());
		WebSocketSettings settings = WebSocketSettings.Holder.get(application);

		connection = settings.getConnectionRegistry().getConnection(application, wsinfo.getSessionId(), wsinfo.getKey());

		if (connection == null)
		{
			LOG.error("WebSocket connection is lost");
		}
	}
	else
	{
		LOG.error("WebSocket client is unknown");
	}

	return connection;
}
 
開發者ID:sebfz1,項目名稱:wicket-quickstart-cdi-async,代碼行數:24,代碼來源:MySession.java

示例2: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Retrieves the instance of settings object.
 * 
 * @return settings instance
 */
public static DashboardSettings get() {
	Application application = Application.get();
	DashboardSettings settings = application.getMetaData(KEY);
	if (settings == null) {
		synchronized (application) {
			settings = application.getMetaData(KEY);
			if (settings == null) {
				settings = new DashboardSettings();
				application.setMetaData(KEY, settings);
			}
		}
	}
	
	return application.getMetaData(KEY);
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:21,代碼來源:DashboardSettings.java

示例3: getLimit

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Determines a limit to use for HTML diff output.
 * 
 * @param key
 *            to use to read the value from the GitBlit settings, if available.
 * @param minimum
 *            minimum value to enforce
 * @param maximum
 *            maximum (and default) value to enforce
 * @return the limit
 */
private int getLimit(String key, int minimum, int maximum) {
	if (Application.exists()) {
		Application application = Application.get();
		if (application instanceof GitBlitWebApp) {
			GitBlitWebApp webApp = (GitBlitWebApp) application;
			int configValue = webApp.settings().getInteger(key, maximum);
			if (configValue < minimum) {
				return minimum;
			} else if (configValue < maximum) {
				return configValue;
			}
		}
	}
	return maximum;
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:27,代碼來源:GitBlitDiffFormatter.java

示例4: internalMap

import org.apache.wicket.Application; //導入方法依賴的package包/類
private IRequestHandler internalMap(Exception e) {
    final Application application = Application.get();

    // check if we are processing an Ajax request and if we want to invoke the failure handler
    if (isAjaxRequest() && shouldInvokeClientSideFailureHandler(application)) {
        return new ErrorCodeRequestHandler(INTERNAL_SERVER_ERROR);
    }

    if (e instanceof StalePageException) {
        // If the page was stale, just re-render it (the url should always be updated by an redirect in that case)
        return new RenderPageRequestHandler(new PageProvider(((StalePageException) e).getPage()));
    } else if (e instanceof PageExpiredException) {
        return createPageRequestHandler(application.getApplicationSettings().getPageExpiredErrorPage());
    } else if (e instanceof AuthorizationException || e instanceof ListenerInvocationNotAllowedException) {
        return createPageRequestHandler(application.getApplicationSettings().getAccessDeniedPage());
    } else if (e instanceof ResponseIOException) {
        LOG.error("Connection lost, give up responding.", e);
        return new EmptyRequestHandler();
    } else
        if (e instanceof PackageResource.PackageResourceBlockedException && application.usesDeploymentConfig()) {
        LOG.debug(e.getMessage(), e);
        return new ErrorCodeRequestHandler(NOT_FOUND);
    }

    return mapUnexpectedException(e);
}
 
開發者ID:flex-oss,項目名稱:flex-ui,代碼行數:27,代碼來源:AbstractExceptionMapper.java

示例5: mapUnexpectedException

import org.apache.wicket.Application; //導入方法依賴的package包/類
private IRequestHandler mapUnexpectedException(Exception e) {
    LOG.error("{}: An unexpected error occurred", getExceptionId(e), e);

    Application application = Application.get();
    IExceptionSettings.UnexpectedExceptionDisplay display =
        application.getExceptionSettings().getUnexpectedExceptionDisplay();

    if (IExceptionSettings.SHOW_EXCEPTION_PAGE.equals(display)) {
        return createPageRequestHandler(createExceptionDisplayPageProvider(e));
    } else if (IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE.equals(display)) {
        return createPageRequestHandler(application.getApplicationSettings().getInternalErrorPage());
    } else {
        // IExceptionSettings.SHOW_NO_EXCEPTION_PAGE
        return new ErrorCodeRequestHandler(INTERNAL_SERVER_ERROR);
    }
}
 
開發者ID:flex-oss,項目名稱:flex-ui,代碼行數:17,代碼來源:AbstractExceptionMapper.java

示例6: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
    * Retrieves the instance of settings object.
    * 
    * @return settings instance
    */
   public static ApplicationSettings get() {
// FIXME Application should provide setMetadataIfAbsent()
Application application = Application.get();
ApplicationSettings settings = application.getMetaData(KEY);
if (settings == null) {
    synchronized (application) {
	settings = application.getMetaData(KEY);
	if (settings == null) {
	    settings = new ApplicationSettings();
	    application.setMetaData(KEY, settings);
	}
    }
}
return application.getMetaData(KEY);
   }
 
開發者ID:PkayJava,項目名稱:pluggable,代碼行數:21,代碼來源:ApplicationSettings.java

示例7: pushJsonWebSocketMessage

import org.apache.wicket.Application; //導入方法依賴的package包/類
public void pushJsonWebSocketMessage(String json) {
    Application application = Application.get();
    WebSocketSettings settings = WebSocketSettings.Holder.get(application);
    IWebSocketConnectionRegistry registry = settings.getConnectionRegistry();
    IWebSocketConnection connection = registry.getConnection(application, webSocketSessionId, webSocketClientKey);
    if (connection == null) {
        logger.warn("websocket client lookup failed for web-socket session: {}", webSocketSessionId);
        return;
    }
    try {
        connection.sendMessage(json);
    } catch (Exception e) {
        logger.error("websocket push failed", e);
    }
}
 
開發者ID:intuit,項目名稱:karate,代碼行數:16,代碼來源:FeaturePage.java

示例8: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static BasicApplicationApplication get() {
	final Application application = Application.get();
	if (application instanceof BasicApplicationApplication) {
		return (BasicApplicationApplication) application;
	}
	throw new WicketRuntimeException("There is no BasicApplicationApplication attached to current thread " +
			Thread.currentThread().getName());
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:9,代碼來源:BasicApplicationApplication.java

示例9: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static ShowcaseApplication get() {
	final Application application = Application.get();
	if (application instanceof ShowcaseApplication) {
		return (ShowcaseApplication) application;
	}
	throw new WicketRuntimeException("There is no ShowcaseApplication attached to current thread " +
			Thread.currentThread().getName());
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:9,代碼來源:ShowcaseApplication.java

示例10: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static CoreWicketAuthenticatedApplication get() {
	final Application application = Application.get();
	if (application instanceof CoreWicketAuthenticatedApplication) {
		return (CoreWicketAuthenticatedApplication) application;
	}
	throw new WicketRuntimeException("There is no CoreWicketAuthenticatedApplication attached to current thread " +
			Thread.currentThread().getName());
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:9,代碼來源:CoreWicketAuthenticatedApplication.java

示例11: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static CoreWicketApplication get() {
	final Application application = Application.get();
	if (application instanceof CoreWicketApplication) {
		return (CoreWicketApplication) application;
	}
	throw new WicketRuntimeException("There is no CoreWicketApplication attached to current thread " +
			Thread.currentThread().getName());
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:9,代碼來源:CoreWicketApplication.java

示例12: destroyApplication

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static void destroyApplication() {
	WebApplication app = (WebApplication)Application.get(getWicketApplicationName());
	WebApplicationContext ctx = getWebApplicationContext(app.getServletContext());
	app.internalDestroy(); //need to be called to
	if (ctx != null) {
		((XmlWebApplicationContext)ctx).destroy();
	}
	ThreadContext.setApplication(null);
	ThreadContext.setRequestCycle(null);
	ThreadContext.setSession(null);
}
 
開發者ID:apache,項目名稱:openmeetings,代碼行數:12,代碼來源:ApplicationHelper.java

示例13: send

import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public void send(IWebSocketPushMessage event) {
	Application application = Application.get(WicketWebInitializer.WICKET_FILTERNAME);
	WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
	IWebSocketConnectionRegistry connectionRegistry = webSocketSettings.getConnectionRegistry();
	Collection<IWebSocketConnection> connections = connectionRegistry.getConnections(application);
	log.trace("sending event to {} connections", connections.size());
	for (IWebSocketConnection connection : connections) {
		connection.sendMessage(event);
	}
}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:12,代碼來源:WebSocketMessageSenderDefault.java

示例14: valueUnbound

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * @see javax.servlet.http.HttpSessionBindingListener#valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
 */
@Override
public void valueUnbound(final HttpSessionBindingEvent evt)
{
	String sessionId = evt.getSession().getId();

	log.debug("Session unbound: {}", sessionId);

	if (wicketSession != null)
	{
		wicketSession.onInvalidate();
	}
	
	Application application = Application.get(applicationKey);
	if (application == null)
	{
		log.debug("Wicket application with name '{}' not found.", applicationKey);
		return;
	}

	ISessionStore sessionStore = application.getSessionStore();
	if (sessionStore != null)
	{
		if (sessionStore instanceof HttpSessionStore)
		{
			((RedisSessionStore) sessionStore).onUnbind(sessionId);
		}

		for (UnboundListener listener : sessionStore.getUnboundListener())
		{
			listener.sessionUnbound(sessionId);
		}
	}
}
 
開發者ID:baholladay,項目名稱:WicketRedisSession,代碼行數:37,代碼來源:RedisSessionStore.java

示例15: rebuildSiteMap

import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public void rebuildSiteMap() {
    // get the first application key (in aol it will not work!)
    ArtifactoryApplication app = (ArtifactoryApplication) Application.get(
            Application.getApplicationKeys().iterator().next());
    // we must attach the application to the current thread in order to perform wicket operation
    ThreadContext.setApplication(app);
    try {
        app.rebuildSiteMap();
    } finally {
        ThreadContext.detach();
    }
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:14,代碼來源:WebappServiceImpl.java


注:本文中的org.apache.wicket.Application.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。