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


Java Application.setMetaData方法代碼示例

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


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

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

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

示例3: init

import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public void init(Application application) {
	// create dashboard context
	DashboardContext dashboardContext = new DashboardContext();
	
	// store dashboard context in application
       application.setMetaData(DASHBOARD_CONTEXT_KEY, dashboardContext);
       
    // add dashboard context injector
    DashboardContextInjector dashboardContextInjector = new DashboardContextInjector(dashboardContext);
    application.getComponentInstantiationListeners().add(dashboardContextInjector);
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:13,代碼來源:DashboardContextInitializer.java

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

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

示例6: init

import org.apache.wicket.Application; //導入方法依賴的package包/類
public void init(Application application) {
	ISessionStore store = application.getSessionStore();
	store.registerBindListener(this);
	store.registerUnboundListener(this);
	application.setMetaData(SCRIPT_EXECUTOR_HOLDER, this);
}
 
開發者ID:PhantomYdn,項目名稱:wicket-console,代碼行數:7,代碼來源:ScriptExecutorHolder.java

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

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


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