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


Java Application.getMetaData方法代碼示例

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


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

示例1: getConnection

import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public IWebSocketConnection getConnection(Application application, String sessionId, IKey key)
{
	Args.notNull(application, "application");
	Args.notNull(sessionId, "sessionId");
	Args.notNull(key, "key");

	IWebSocketConnection connection = null;
	ConcurrentMap<String, ConcurrentMap<IKey, IWebSocketConnection>> connectionsBySession = application.getMetaData(KEY);
	if (connectionsBySession != null)
	{
		ConcurrentMap<IKey, IWebSocketConnection> connectionsByPage = connectionsBySession.get(sessionId);
		if (connectionsByPage != null)
		{
			connection = connectionsByPage.get(key);
		}
	}
	return connection;
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:20,代碼來源:SimpleWebSocketConnectionRegistry.java

示例2: getConnections

import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public Collection<IWebSocketConnection> getConnections(Application application, String sessionId)
{
	Args.notNull(application, "application");
	Args.notNull(sessionId, "sessionId");

	Collection<IWebSocketConnection> connections = Collections.emptyList();
	ConcurrentMap<String, ConcurrentMap<IKey, IWebSocketConnection>> connectionsBySession = application.getMetaData(KEY);
	if (connectionsBySession != null)
	{
		ConcurrentMap<IKey, IWebSocketConnection> connectionsByPage = connectionsBySession.get(sessionId);
		if (connectionsByPage != null)
		{
			connections = connectionsByPage.values();
		}
	}
	return connections;
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:19,代碼來源:SimpleWebSocketConnectionRegistry.java

示例3: 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

示例4: 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

示例5: getSettings

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Returns Leaflet settings of given application.
 *
 * @param application application, which setting are retrieved
 * @return leaflet settings of application
 * @throws IllegalArgumentException if application is {@code null}
 * @throws IllegalStateException if Leaflet is not installed in application
 */
public static LeafletSettings getSettings(Application application) {
    // get settings by MetaKey
    Args.notNull(application, "application");
    LeafletSettings settings = application.getMetaData(LEAFLET_SETTINGS_KEY);

    if (settings == null) {
        throw new IllegalStateException("Leaflets aren't installed in application [" + application.getName() + "].");
    }

    return settings;
}
 
開發者ID:DrunkenPandaFans,項目名稱:wicket-leaflet,代碼行數:20,代碼來源:Leaflet.java

示例6: configure

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Configures the specified application
 *
 * @param application
 * @return
 */
public void configure(Application application) {
    if (application.getMetaData(CDI_CONFIGURATION_KEY) != null) {
        throw new IllegalStateException("Cdi already configured for this application");
    }
    application.setMetaData(CDI_CONFIGURATION_KEY, this);

    RequestCycleListenerCollection listeners = new RequestCycleListenerCollection();
    application.getRequestCycleListeners().add(listeners);

    // enable conversation propagation
    if (getPropagation() != ConversationPropagation.NONE) {
        listeners.add(new ConversationPropagator(application, getPropagation()));
        application.getComponentPreOnBeforeRenderListeners().add(
                new AutoConversationManager(getPropagation()));
        application.getComponentPreOnBeforeRenderListeners().add(
                new ConversationExpiryChecker());
    }

    // enable detach event
    listeners.add(new DetachEventEmitter());

    NonContextual.of(application.getClass()).postConstruct(application);

    // enable injection of various framework components
    application.getSessionListeners().add(new SessionInjector());
    application.getComponentInstantiationListeners().add(new ExtendedComponentInjector());
    application.getBehaviorInstantiationListeners().add(new BehaviorInjector());

    // enable cleanup
    application.getApplicationListeners().add(new CdiShutdownCleaner());
}
 
開發者ID:MichaelRehberg,項目名稱:gluezilla,代碼行數:38,代碼來源:ExtendedCdiConfiguration.java

示例7: setConnection

import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public void setConnection(Application application, String sessionId, IKey key, IWebSocketConnection connection)
{
	Args.notNull(application, "application");
	Args.notNull(sessionId, "sessionId");
	Args.notNull(key, "key");

	ConcurrentMap<String, ConcurrentMap<IKey, IWebSocketConnection>> connectionsBySession = application.getMetaData(KEY);
	if (connectionsBySession == null)
	{
		synchronized (KEY)
		{
			connectionsBySession = application.getMetaData(KEY);
			if (connectionsBySession == null)
			{
				connectionsBySession = Generics.newConcurrentHashMap();
				application.setMetaData(KEY, connectionsBySession);
			}
		}
	}

	ConcurrentMap<IKey, IWebSocketConnection> connectionsByPage = connectionsBySession.get(sessionId);
	if (connectionsByPage == null && connection != null)
	{
		connectionsByPage = connectionsBySession.get(sessionId);
		if (connectionsByPage == null)
		{
			connectionsByPage = Generics.newConcurrentHashMap();
			ConcurrentMap<IKey, IWebSocketConnection> old = connectionsBySession.putIfAbsent(sessionId, connectionsByPage);
			if (old != null)
			{
				connectionsByPage = old;
			}
		}
	}

	if (connection != null)
	{
		connectionsByPage.put(key, connection);
	}
	else if (connectionsByPage != null)
	{
		connectionsByPage.remove(key);
		if (connectionsByPage.isEmpty())
		{
			connectionsBySession.remove(sessionId);
		}
	}
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:50,代碼來源:SimpleWebSocketConnectionRegistry.java

示例8: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static ScriptExecutorHolder get(Application application)
{
	return application.getMetaData(SCRIPT_EXECUTOR_HOLDER);
}
 
開發者ID:PhantomYdn,項目名稱:wicket-console,代碼行數:5,代碼來源:ScriptExecutorHolder.java

示例9: get

import org.apache.wicket.Application; //導入方法依賴的package包/類
public static CdiConfiguration get(Application application) {
    return application.getMetaData(CDI_CONFIGURATION_KEY);
}
 
開發者ID:MichaelRehberg,項目名稱:gluezilla,代碼行數:4,代碼來源:ExtendedCdiConfiguration.java

示例10: authorize

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Authorizes the given roles to create component instances of type
 * componentClass. This authorization is added to any previously authorized
 * roles.
 *
 * @param <T>
 *
 * @param componentClass The component type that is subject for the
 * authorization
 * @param roles The roles that are authorized to create component instances
 * of type componentClass
 */
private static <T extends Component> void authorize(final Class<T> componentClass, final Role... roles) {
	final Application application = Application.get();
	InstantiationPermissions permissions = application.getMetaData(INSTANTIATION_PERMISSIONS);
	if (permissions == null) {
		permissions = new InstantiationPermissions();
		application.setMetaData(INSTANTIATION_PERMISSIONS, permissions);
	}
	permissions.authorize(componentClass, roles);
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:22,代碼來源:MetaDataAuthorizationStrategy.java

示例11: authorizeAll

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Grants permission to all roles to create instances of the given component
 * class.
 *
 * @param <T>
 *
 * @param componentClass The component class
 */
private static <T extends Component> void authorizeAll(final Class<T> componentClass) {
	Application application = Application.get();
	InstantiationPermissions authorizedLevels = application.getMetaData(INSTANTIATION_PERMISSIONS);
	if (authorizedLevels != null) {
		authorizedLevels.authorizeAll(componentClass);
	}
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:16,代碼來源:MetaDataAuthorizationStrategy.java

示例12: authorize

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Authorizes the given role to create component instances of type
 * componentClass. This authorization is added to any previously authorized
 * roles.
 * 
 * @param <T>
 * 
 * @param componentClass
 *            The component type that is subject for the authorization
 * @param roles
 *            The comma separated roles that are authorized to create
 *            component instances of type componentClass
 */
public static final <T extends Component> void authorize(final Class<T> componentClass, final String roles) {
    final Application application = Application.get();
    InstantiationPermissions permissions = application.getMetaData(INSTANTIATION_PERMISSIONS);
    if (permissions == null) {
        permissions = new InstantiationPermissions();
        application.setMetaData(INSTANTIATION_PERMISSIONS, permissions);
    }
    permissions.authorize(componentClass, new Roles(roles));
}
 
開發者ID:PkayJava,項目名稱:pluggable,代碼行數:23,代碼來源:MetaDataRoleAuthorizationStrategy.java

示例13: authorizeAll

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * Grants permission to all roles to create instances of the given component
 * class.
 * 
 * @param <T>
 * 
 * @param componentClass
 *            The component class
 */
public static final <T extends Component> void authorizeAll(final Class<T> componentClass) {
    Application application = Application.get();
    InstantiationPermissions authorizedRoles = application.getMetaData(INSTANTIATION_PERMISSIONS);
    if (authorizedRoles != null) {
        authorizedRoles.authorizeAll(componentClass);
    }
}
 
開發者ID:PkayJava,項目名稱:pluggable,代碼行數:17,代碼來源:MetaDataRoleAuthorizationStrategy.java

示例14: settings

import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
 * returns the {@link ClientSideLoggingSettings} which are assigned to given application
 *
 * @param app The current application
 * @return assigned {@link ClientSideLoggingSettings}
 */
public static IClientSideLoggingSettings settings(final Application app) {
    return app.getMetaData(METADATA_KEY);
}
 
開發者ID:l0rdn1kk0n,項目名稱:wicket-clientside-logging,代碼行數:10,代碼來源:ClientSideLogging.java


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