public class Publisher
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
Publisher(boolean useProps,
java.lang.String initialContextFactory,
java.lang.String providerUrl,
java.lang.String connfactory,
java.lang.String destinationName,
boolean useAuth,
java.lang.String securityPrincipal,
java.lang.String securityCredentials)
Create a publisher using either the jndi.properties file or the provided
parameters.
|
Publisher(boolean useProps,
java.lang.String initialContextFactory,
java.lang.String providerUrl,
java.lang.String connfactory,
java.lang.String destinationName,
boolean useAuth,
java.lang.String securityPrincipal,
java.lang.String securityCredentials,
boolean staticDestination)
Create a publisher using either the jndi.properties file or the provided
parameters
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close will close the session
|
javax.jms.Message |
publish(byte[] bytes,
java.lang.String destinationName,
java.util.Map<java.lang.String,java.lang.Object> properties,
int deliveryMode,
int priority,
long expiration) |
javax.jms.MapMessage |
publish(java.util.Map<java.lang.String,java.lang.Object> map,
java.lang.String destinationName,
java.util.Map<java.lang.String,java.lang.Object> properties,
int deliveryMode,
int priority,
long expiration) |
javax.jms.Message |
publish(java.io.Serializable contents,
java.lang.String destinationName,
java.util.Map<java.lang.String,java.lang.Object> properties,
int deliveryMode,
int priority,
long expiration) |
javax.jms.Message |
publish(java.lang.String text,
java.lang.String destinationName,
java.util.Map<java.lang.String,java.lang.Object> properties,
int deliveryMode,
int priority,
long expiration) |
public Publisher(boolean useProps, java.lang.String initialContextFactory, java.lang.String providerUrl, java.lang.String connfactory, java.lang.String destinationName, boolean useAuth, java.lang.String securityPrincipal, java.lang.String securityCredentials) throws javax.jms.JMSException, javax.naming.NamingException
useProps
- true if a jndi.properties file is to be usedinitialContextFactory
- the (ignored if useProps is true)providerUrl
- (ignored if useProps is true)connfactory
- name of the object factory to look up in contextdestinationName
- name of the destination to useuseAuth
- (ignored if useProps is true)securityPrincipal
- (ignored if useProps is true)securityCredentials
- (ignored if useProps is true)javax.jms.JMSException
- if the context could not be initialised, or there was some
other errorjavax.naming.NamingException
- when creation of the publisher failspublic Publisher(boolean useProps, java.lang.String initialContextFactory, java.lang.String providerUrl, java.lang.String connfactory, java.lang.String destinationName, boolean useAuth, java.lang.String securityPrincipal, java.lang.String securityCredentials, boolean staticDestination) throws javax.jms.JMSException, javax.naming.NamingException
useProps
- true if a jndi.properties file is to be usedinitialContextFactory
- the (ignored if useProps is true)providerUrl
- (ignored if useProps is true)connfactory
- name of the object factory to lookup in contextdestinationName
- name of the destination to useuseAuth
- (ignored if useProps is true)securityPrincipal
- (ignored if useProps is true)securityCredentials
- (ignored if useProps is true)staticDestination
- true if the destination is not to change between loopsjavax.jms.JMSException
- if the context could not be initialised, or there was some
other errorjavax.naming.NamingException
- when creation of the publisher failspublic javax.jms.Message publish(java.lang.String text, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration) throws javax.jms.JMSException, javax.naming.NamingException
javax.jms.JMSException
javax.naming.NamingException
public javax.jms.Message publish(java.io.Serializable contents, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration) throws javax.jms.JMSException, javax.naming.NamingException
javax.jms.JMSException
javax.naming.NamingException
public javax.jms.Message publish(byte[] bytes, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration) throws javax.jms.JMSException, javax.naming.NamingException
javax.jms.JMSException
javax.naming.NamingException
public javax.jms.MapMessage publish(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration) throws javax.jms.JMSException, javax.naming.NamingException
javax.jms.JMSException
javax.naming.NamingException
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.