package org.mxchange.jcoreee.bean;
import java.io.Serializable;
-import java.security.Principal;
import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
Context context = new InitialContext();
// Get factory from JMS resource
- QueueConnectionFactory connectionFactory = (QueueConnectionFactory) context.lookup(factoryJndi); //NOI18N
+ QueueConnectionFactory connectionFactory = (QueueConnectionFactory) context.lookup(factoryJndi);
// Lookup queue
- this.queue = (Queue) context.lookup(queueJndi); //NOI18N
+ this.queue = (Queue) context.lookup(queueJndi);
// Create connection
this.connection = connectionFactory.createConnection();
}
}
- /**
- * Determines principal's name or returns null if no principal (security) is
- * set.
- * <p>
- * @return Principal's name or null
- */
- protected String determinePrincipalName () {
- // Get principal
- Principal userPrincipal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();
-
- // Init with null
- String principalName = null;
-
- // Is the principal set?
- if (userPrincipal instanceof Principal) {
- // Get principal's name
- principalName = userPrincipal.getName();
- }
-
- // Return it
- return principalName;
- }
-
/**
* Getter for configured message producer instance
* <p>
*/
package org.mxchange.jcoreee.bean.faces;
+import java.security.Principal;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.MissingResourceException;
super();
}
+ /**
+ * Determines principal's name or returns null if no principal (security) is
+ * set.
+ * <p>
+ * @return Principal's name or null
+ */
+ protected String determinePrincipalName () {
+ // Get principal
+ Principal userPrincipal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();
+
+ // Init with null
+ String principalName = null;
+
+ // Is the principal set?
+ if (userPrincipal instanceof Principal) {
+ // Get principal's name
+ principalName = userPrincipal.getName();
+ }
+
+ // Return it
+ return principalName;
+ }
+
/**
* Returns given property key or throws an exception if not found.
* <p>