Closeable, AutoCloseablepublic class Publisher extends Object implements Closeable
| Constructor | Description |
|---|---|
Publisher(boolean useProps,
String initialContextFactory,
String providerUrl,
String connfactory,
String destinationName,
boolean useAuth,
String securityPrincipal,
String securityCredentials) |
Create a publisher using either the jndi.properties file or the provided
parameters.
|
Publisher(boolean useProps,
String initialContextFactory,
String providerUrl,
String connfactory,
String destinationName,
boolean useAuth,
String securityPrincipal,
String securityCredentials,
boolean staticDestination) |
Create a publisher using either the jndi.properties file or the provided
parameters
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Close will close the session
|
Message |
publish(byte[] bytes,
String destinationName,
Map<String,Object> properties,
int deliveryMode,
int priority,
long expiration) |
|
Message |
publish(Serializable contents,
String destinationName,
Map<String,Object> properties,
int deliveryMode,
int priority,
long expiration) |
|
Message |
publish(String text,
String destinationName,
Map<String,Object> properties,
int deliveryMode,
int priority,
long expiration) |
|
MapMessage |
publish(Map<String,Object> map,
String destinationName,
Map<String,Object> properties,
int deliveryMode,
int priority,
long expiration) |
public Publisher(boolean useProps,
String initialContextFactory,
String providerUrl,
String connfactory,
String destinationName,
boolean useAuth,
String securityPrincipal,
String securityCredentials)
throws JMSException,
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)JMSException - if the context could not be initialised, or there was some
other errorNamingException - when creation of the publisher failspublic Publisher(boolean useProps,
String initialContextFactory,
String providerUrl,
String connfactory,
String destinationName,
boolean useAuth,
String securityPrincipal,
String securityCredentials,
boolean staticDestination)
throws JMSException,
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 loopsJMSException - if the context could not be initialised, or there was some
other errorNamingException - when creation of the publisher failspublic Message publish(String text, String destinationName, Map<String,Object> properties, int deliveryMode, int priority, long expiration) throws JMSException, NamingException
JMSExceptionNamingExceptionpublic Message publish(Serializable contents, String destinationName, Map<String,Object> properties, int deliveryMode, int priority, long expiration) throws JMSException, NamingException
JMSExceptionNamingExceptionpublic Message publish(byte[] bytes,
String destinationName,
Map<String,Object> properties,
int deliveryMode,
int priority,
long expiration)
throws JMSException,
NamingException
JMSExceptionNamingExceptionpublic MapMessage publish(Map<String,Object> map, String destinationName, Map<String,Object> properties, int deliveryMode, int priority, long expiration) throws JMSException, NamingException
JMSExceptionNamingExceptionpublic void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.