This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewConversationExpirationEvaluator | |
implements ConversationExpirationEvaluator | |
{ | |
private static final long serialVersionUID = -1298186767354202960L; | |
private String viewId; | |
private boolean expired; | |
ViewConversationExpirationEvaluator() | |
{ | |
if(FacesContext.getCurrentInstance().getViewRoot() != null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.os890.codi.addon.conversation.api.ViewConversationScoped; | |
import javax.annotation.PostConstruct; | |
import javax.inject.Named; | |
import java.io.Serializable; | |
import java.util.Date; | |
@Named | |
@ViewConversationScoped | |
public class ViewConversationBean implements Serializable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ApplicationScoped | |
public class SimulatedViewScopeObserver | |
{ | |
protected void observeNavigation( | |
@Observes PreViewConfigNavigateEvent preViewConfigNavigateEvent, | |
EditableWindowContext editableWindowContext) | |
{ | |
if (!preViewConfigNavigateEvent.getFromView() | |
.equals(preViewConfigNavigateEvent.getToView())) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ConversationScoped | |
public class ConversationAwareNoSqlTransactionProxy implements Transaction, Serializable | |
{ | |
private NoSqlDb noSqlDb; //handle serialization (if needed/supported) | |
private Transaction transaction; //handle serialization (if needed/supported) | |
//required by proxy libs | |
protected ConversationAwareNoSqlTransactionProxy() | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//for a partial integration in GlassFish3 in case of: | |
//java.lang.NullPointerException at com.sun.jersey.server.impl.cdi.CDIExtension.processAnnotatedField | |
public class JerseyAwareLoaderService extends DefaultLoaderService | |
{ | |
@Override | |
public <T> List<T> load(Class<T> serviceType, ClassLoader classLoader) | |
{ | |
List<T> result = super.load(serviceType, classLoader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//nesting leads to the path of a page (-> view-id) and inheritance to meta-data-inheritance | |
//currently there would be no ide support to show where the meta-data comes from in case of meta-data-inheritance via nesting | |
//(it's easy to see in small applications but difficult in large applications) | |
//represents a folder | |
@Page(navigation = REDIRECT) | |
public interface Pages | |
{ | |
//represents a folder | |
//can be referenced via @ConversationGroup, @View, @Matches,... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WeldFilter implements Extension | |
{ | |
public void vetoForWeld(@Observes ProcessAnnotatedType processAnnotatedType, BeanManager beanManager) | |
{ | |
if (!beanManager.getClass().getName().contains("org.apache.")) | |
{ | |
processAnnotatedType.veto(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyActor extends UntypedActor | |
{ | |
@Inject | |
private MyService myService; | |
@Override | |
public void onReceive(Object o) throws Exception | |
{ | |
myService.process(/*...*/); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//starts the container once and one session + request per test-method | |
@RunWith(CdiTestRunner.class) | |
public class ContainerAndInjectionControl | |
{ | |
@Inject | |
private ApplicationScopedBean applicationScopedBean; | |
@Inject | |
private SessionScopedBean sessionScopedBean; |
OlderNewer