Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed async behavior, didn't work as expected. Added in support for…
… changing @Inject point to use Routing literals. Added new test case to verify behavior. Reduced logging levels.
- Loading branch information
Showing
12 changed files
with
133 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ target | |
.project | ||
.settings | ||
*.sw? | ||
transaction.log |
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
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
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
46 changes: 46 additions & 0 deletions
46
impl/src/main/java/org/jboss/seam/jms/annotations/RoutingLiteral.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2011, Red Hat, Inc. and/or its affiliates, 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.seam.jms.annotations; | ||
|
||
import javax.enterprise.util.AnnotationLiteral; | ||
|
||
import org.jboss.seam.jms.bridge.RouteType; | ||
|
||
/**RoutingLiteral - literal implementation of the Routing qualifier. | ||
* | ||
* provides two static members, representing EGRESS and INGRESS. | ||
* | ||
* @author johnament | ||
* | ||
*/ | ||
public class RoutingLiteral extends AnnotationLiteral<Routing> implements Routing { | ||
private RouteType routeType; | ||
|
||
public static final Routing EGRESS = new RoutingLiteral(RouteType.EGRESS); | ||
public static final Routing INGRESS = new RoutingLiteral(RouteType.INGRESS); | ||
|
||
public RoutingLiteral(RouteType routeType) { | ||
this.routeType = routeType; | ||
} | ||
|
||
@Override | ||
public RouteType value() { | ||
// TODO Auto-generated method stub | ||
return routeType; | ||
} | ||
|
||
} |
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
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
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
49 changes: 49 additions & 0 deletions
49
impl/src/test/java/org/jboss/seam/jms/test/bridge/intf/BidirectionalTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.jboss.seam.jms.test.bridge.intf; | ||
|
||
import javax.enterprise.event.Event; | ||
import javax.enterprise.event.Observes; | ||
import javax.inject.Inject; | ||
|
||
import junit.framework.Assert; | ||
|
||
import org.jboss.arquillian.api.Deployment; | ||
import org.jboss.arquillian.junit.Arquillian; | ||
import org.jboss.seam.jms.annotations.Routing; | ||
import org.jboss.seam.jms.bridge.RouteBuilder; | ||
import org.jboss.seam.jms.bridge.RouteType; | ||
import org.jboss.seam.jms.impl.inject.ConnectionProducer; | ||
import org.jboss.seam.jms.impl.inject.DestinationProducer; | ||
import org.jboss.seam.jms.impl.inject.MessagePubSubProducer; | ||
import org.jboss.seam.jms.test.Util; | ||
import org.jboss.seam.solder.bean.ImmutableInjectionPoint; | ||
import org.jboss.shrinkwrap.api.Archive; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(Arquillian.class) | ||
public class BidirectionalTest { | ||
|
||
@Deployment | ||
public static Archive<?> createDeployment() { | ||
return Util.createDeployment(ObserverInterface.class, ImmutableInjectionPoint.class, | ||
DestinationProducer.class, MessagePubSubProducer.class, | ||
RouteBuilder.class, ConnectionProducer.class); | ||
} | ||
|
||
@Inject @Routing(RouteType.EGRESS) | ||
Event<Double> doubleEvent; | ||
@Inject RouteBuilder builder; | ||
|
||
private static boolean received = false; | ||
|
||
@Test | ||
public void testSendingAndReceiving() throws Exception { | ||
doubleEvent.fire(7.08); | ||
Thread.sleep(7000); | ||
Assert.assertTrue(received); | ||
} | ||
|
||
public void observeDoubleOverJms(@Observes @Routing(RouteType.INGRESS) Double d) { | ||
received = true; | ||
} | ||
} |
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
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
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