Pollination by Honey Bees
4 weeks ago
<filter>
<filter-name>CAS Authentication Filter</filter-name>
<filter-class>my.org.security.servlet.ConditionalFilter</filter-class>
<init-param>
<param-name>condition</param-name>
<param-value>cas/enabled</param-value>
</init-param>
<init-param>
<param-name>wrapped-class</param-name>
<param-value>org.jasig.cas.client.authentication.AuthenticationFilter</param-value>
</init-param>
</filter>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<jbossHome>${jboss.home}</jbossHome>
<serverName>default</serverName>
<fileName>target/my-app.war</fileName>
</configuration>
</plugin>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.PostReplaceFilter</param-value>
</init-param>The next step is to issue the AJAX request (in this case we're going to issue a POST but tell Jersey to invoke the PUT mapped method instead):Ext.Ajax.request({ headers : {
'X-HTTP-Method-Override' : 'PUT'
},
method: 'POST',
url: '/my-api/some-service',
params: {
name : someObj.name,
date : someObj.date,
amount : someObj.amount
},
success: this.onSaveSuccess.createDelegate(this),
failure: this.onSaveFailure.createDelegate(this)
});.dataViewNode {
width: 10em;
float: left;
height: auto;
overflow: hidden;
position: relative;
margin: 4px;
z-index: 5;
text-align: center;
padding: 2px 0 0 0;
font-size: 0.8em;
} URL url = new URL("http://www.google.com/intl/en_ALL/images/logo.gif");
BufferedImage image = ImageIO.read(url);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(image, "gif", os);
InputStream is = new ByteArrayInputStream(os.toByteArray());
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.1.4.1</version>
<scope>provided</scope>
</dependency>
Also, I was hoping the @EJB annotation in my rest service class would inject my stateless bean reference, but it did not - I had to use JNDI. By default, OpenEJB uses the following scheme (you can configure) for naming your beans in JNDI: implementation class name + either 'Local' or 'Remote'.| Characteristic | Web Services | JMS | JCA |
|---|---|---|---|
| sync vs. async | sync | async | |
| security/encryption | yes, WS-Security | yes | |
| transactions | yes | yes | yes |
| reliability (guaranteed delivery) | yes | yes | |
| batch | |||
| systems use same technology | java-non java | java-java | java-legacy/EIS |
| Name | Description |
|---|---|
| Creational Patterns (AbFacBuildFacProSingle) | |
| Abstract Factory | interface for creating family of related/dependent objects without specifying concrete classes |
| Builder | separates construction from representation; same construction process can create different objects |
| Factory Method | interface for creating an object; lets subclasses decide which class to instantiate |
| Prototype | |
| Singleton | controls access to finite number of instances |
| Structural Patterns (AdBriComDecFaFlyProx) | |
| Adapter | convert one interface to one the client expects |
| Bridge | functional abstraction -> internal implementation |
| Composite | hierarchical tree structures with elements of varying complexity but a uniform interface |
| Decorator | add or remove functionality without changing external appearance |
| Facade | unifying interface on top of a group of interfaces/components of a subsystem |
| Flyweight | sharing/reusing objects |
| Proxy | surrogate controls access to real object |
| Behavioral Patterns (ChainComIntItMedMemObStateStratTempVis or C2I2M2-OSS-TV) | |
| Chain of Responsibility | message handled where it is first received or directed on to another object for handling |
| Command | |
| Interpreter | |
| Iterator | sequentially access items in a collection that is separate from the underlying collection |
| Mediator | object that manages message distribution among other objects |
| Memento | represents snapshot of object's state |
| Observer | broadcast messages to interested listeners |
| State | object alters behavior when internal state changes |
| Strategy | group of classes that represent a set of possible behaviors |
| Template Method | |
| Visitor | think of using the enhanced for to iterate over a list in java and perform some operation on that list |
| Strategy | Ease of Development | Performance | Scalability | Extensibility | Security | Strategy |
|---|---|---|---|---|---|---|
| CMP | relatively simple; preferred over BMP | container dependent | EJB container dependent *a | varies by implementation | EJB provided | CMP |
| BMP | more involved | very efficient w/control over SQL | EJB container dependent *a | varies by implementation | EJB provided | BMP |
| JDO | simple | possibly some performance penalty | developer managed | varies by implementation | developer managed | JDO |
| JPA | the simplest | possibly some performance penalty | EJB container dependent *a | varies by implementation | EJB provided | JPA |
| ORM/DAOs | simple | possibly some performance penalty | developer managed | varies by implementation | developer managed | ORM/DAOs |
| JDBC | most time-consuming and involved | theoretical best performance | developer managed | varies by implementation | developer managed | JDBC |
| iBatis/DAO | somewhere between ORM and JDBC | excellent performance | developer managed | varies by implementation | developer managed | iBatis/DAO |
not covered by SCEA exam
Spring can help level the playing field outside EJB in some of the above developer managed areas by helping with transactioning, scalability and security.