This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Stockinger
committed
Sep 11, 2017
1 parent
81e4043
commit de1220a
Showing
30 changed files
with
2,703 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apply plugin: 'java' | ||
|
||
dependencies { | ||
compile libWeld | ||
compile libJavaEE | ||
compile libSlf4j | ||
compile project(":common") | ||
compile project(":core-spi") | ||
|
||
testCompile libJUnit4 | ||
testCompile libLogback | ||
testCompile project(":core") | ||
} |
297 changes: 297 additions & 0 deletions
297
jms/src/main/java/fi/testee/jms/AbstractMessageImpl.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,297 @@ | ||
/* | ||
* Copyright (C) 2017 Alex Stockinger | ||
* | ||
* 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 fi.testee.jms; | ||
|
||
import javax.jms.Destination; | ||
import javax.jms.JMSException; | ||
import javax.jms.Message; | ||
import java.io.UnsupportedEncodingException; | ||
import java.util.Enumeration; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class AbstractMessageImpl implements Message { | ||
private final Map<String, Object> props = new HashMap<>(); | ||
|
||
private String id; | ||
private long timestamp; | ||
private byte[] correlationId; | ||
private Destination destination; | ||
private Destination replyTo; | ||
private int deliveryMode; | ||
private boolean redelivered; | ||
private String type; | ||
private long expiration; | ||
private long deliveryTime; | ||
private int priority; | ||
|
||
@Override | ||
public String getJMSMessageID() throws JMSException { | ||
return id; | ||
} | ||
|
||
@Override | ||
public void setJMSMessageID(final String id) throws JMSException { | ||
this.id = id; | ||
} | ||
|
||
@Override | ||
public long getJMSTimestamp() throws JMSException { | ||
return timestamp; | ||
} | ||
|
||
@Override | ||
public void setJMSTimestamp(long timestamp) throws JMSException { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
@Override | ||
public byte[] getJMSCorrelationIDAsBytes() throws JMSException { | ||
return correlationId; | ||
} | ||
|
||
@Override | ||
public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException { | ||
this.correlationId = correlationID; | ||
} | ||
|
||
@Override | ||
public void setJMSCorrelationID(String correlationID) throws JMSException { | ||
try { | ||
correlationId = correlationID.getBytes("iso-8859-1"); | ||
} catch (UnsupportedEncodingException e) { | ||
final JMSException jmsException = new JMSException("Failed to get bytes from correlationID string"); | ||
jmsException.setLinkedException(e); | ||
throw jmsException; | ||
} | ||
} | ||
|
||
@Override | ||
public String getJMSCorrelationID() throws JMSException { | ||
try { | ||
return new String(correlationId, "iso-8859-1"); | ||
} catch (UnsupportedEncodingException e) { | ||
final JMSException jmsException = new JMSException("Failed to get string from correlationID bytes"); | ||
jmsException.setLinkedException(e); | ||
throw jmsException; | ||
} | ||
} | ||
|
||
@Override | ||
public Destination getJMSReplyTo() throws JMSException { | ||
return replyTo; | ||
} | ||
|
||
@Override | ||
public void setJMSReplyTo(Destination replyTo) throws JMSException { | ||
this.replyTo = replyTo; | ||
} | ||
|
||
@Override | ||
public Destination getJMSDestination() throws JMSException { | ||
return destination; | ||
} | ||
|
||
@Override | ||
public void setJMSDestination(Destination destination) throws JMSException { | ||
this.destination = destination; | ||
} | ||
|
||
@Override | ||
public int getJMSDeliveryMode() throws JMSException { | ||
return deliveryMode; | ||
} | ||
|
||
@Override | ||
public void setJMSDeliveryMode(int deliveryMode) throws JMSException { | ||
this.deliveryMode = deliveryMode; | ||
} | ||
|
||
@Override | ||
public boolean getJMSRedelivered() throws JMSException { | ||
return redelivered; | ||
} | ||
|
||
@Override | ||
public void setJMSRedelivered(boolean redelivered) throws JMSException { | ||
this.redelivered = redelivered; | ||
} | ||
|
||
@Override | ||
public String getJMSType() throws JMSException { | ||
return type; | ||
} | ||
|
||
@Override | ||
public void setJMSType(String type) throws JMSException { | ||
this.type = type; | ||
} | ||
|
||
@Override | ||
public long getJMSExpiration() throws JMSException { | ||
return expiration; | ||
} | ||
|
||
@Override | ||
public void setJMSExpiration(long expiration) throws JMSException { | ||
this.expiration = expiration; | ||
} | ||
|
||
@Override | ||
public long getJMSDeliveryTime() throws JMSException { | ||
return deliveryTime; | ||
} | ||
|
||
@Override | ||
public void setJMSDeliveryTime(long deliveryTime) throws JMSException { | ||
this.deliveryTime = deliveryTime; | ||
} | ||
|
||
@Override | ||
public int getJMSPriority() throws JMSException { | ||
return priority; | ||
} | ||
|
||
@Override | ||
public void setJMSPriority(int priority) throws JMSException { | ||
this.priority = priority; | ||
} | ||
|
||
@Override | ||
public void clearProperties() throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public boolean propertyExists(String name) throws JMSException { | ||
return props.containsKey(name); | ||
} | ||
|
||
@Override | ||
public boolean getBooleanProperty(String name) throws JMSException { | ||
return false; | ||
} | ||
|
||
@Override | ||
public byte getByteProperty(String name) throws JMSException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public short getShortProperty(String name) throws JMSException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int getIntProperty(String name) throws JMSException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getLongProperty(String name) throws JMSException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public float getFloatProperty(String name) throws JMSException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public double getDoubleProperty(String name) throws JMSException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public String getStringProperty(String name) throws JMSException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Object getObjectProperty(String name) throws JMSException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Enumeration getPropertyNames() throws JMSException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void setBooleanProperty(String name, boolean value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setByteProperty(String name, byte value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setShortProperty(String name, short value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setIntProperty(String name, int value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setLongProperty(String name, long value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setFloatProperty(String name, float value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setDoubleProperty(String name, double value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setStringProperty(String name, String value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void setObjectProperty(String name, Object value) throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void acknowledge() throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public void clearBody() throws JMSException { | ||
|
||
} | ||
|
||
@Override | ||
public <T> T getBody(Class<T> c) throws JMSException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isBodyAssignableTo(Class c) throws JMSException { | ||
return false; | ||
} | ||
} |
Oops, something went wrong.