Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2010, Red Hat, Inc., and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.serialization.spi;
Application wide contextual identifier service which allows a serializable reference to a contextual to be obtained, and the contextual to be returned for a given id.

If the contextual implements PassivationCapable, the id will be obtained from it, in which case the Contextual can be activated in any container. If not, the Contextual can only be activated in this container.

Note that this allows a Bean object to be loaded regardless of the bean's accessiblity from the current module, and should not be abused as a way to ignore accessibility rules enforced during resolution.

Author(s):
Pete Muir
Marius Bogoevici
public interface ContextualStore extends Service {
    
Given a particular id, return the correct contextual. For contextuals which aren't passivation capable, the contextual can't be found in another container, and null will be returned.

Parameters:
id An identifier for the contextual
Returns:
the contextual
    <C extends Contextual<I>, I> C getContextual(String id);
    <C extends Contextual<I>, I> C getContextual(BeanIdentifier identifier);

    
Add a contextual (if not already present) to the store, and return it's id. If the contextual is passivation capable, it's id will be used, otherwise an id will be generated

Parameters:
contextual the contexutal to add
Returns:
the current id for the contextual
    BeanIdentifier putIfAbsent(Contextual<?> contextual);

    
Returns a org.jboss.weld.serialization.spi.helpers.SerializableContextual that corresponds to the given javax.enterprise.context.spi.Contextual

Parameters:
contextual the contextual for which the serializable contextual is created
Returns:
a serializable contextual
    <C extends Contextual<I>, I> SerializableContextual<C, I> getSerializableContextual(Contextual<I> contextual);

    
Returns a org.jboss.weld.serialization.spi.helpers.SerializableContextualInstance that corresponds to the given instance and javax.enterprise.context.spi.Contextual

Parameters:
contextual the contextual for which the serializable contextual instance is returned
instance the instance
creationalContext the creational context of the instance
Returns:
the serializable contextual instance
    <C extends Contextual<I>, I> SerializableContextualInstance<C, I> getSerializableContextualInstance(Contextual<I> contextual, I instanceCreationalContext<I> creationalContext);
New to GrepCode? Check out our FAQ X