EJB / EE :: Verify If Interceptor Is Invoked
Oct 20, 2014
I have an interceptor (configured with beans.xml from the following link, IBM Specs) on JAX-RS resource method for checking user entitlements. How can i verify if the interceptor (method annotated with @AroundInvoke) is being invoked?
View Replies
Oct 15, 2014
I have just enabled CDI on Websphere 8.5.5 and added interceptors
In beans.xml file
<?xml version="1.0"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance"
xsi:schemeLocation="http://java.sun.com/xml/ns/javaee http://
java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<interceptors>
<class>com.example.jaxrs.SecurityChecked</class>
</interceptors>
</beans>
[code].....
When i deploy EAR, i get below error.
WebContainerL I WebContainerLifecycle startApplication OpenWebBeans Container is starting...
[10/15/14 14:53:15:259 EDT] 00000067 BeansDeployer E BeansDeployer deploy org.apache.webbeans.exception.WebBeansConfigurationException: Given class : interface com.example.jaxrs.SecurityChecked is not a interceptor class
what would be the cause of this error?
View Replies
View Related
Mar 22, 2015
I hope this is the right forum. My question is about REST interceptors. I've got the code:
package edu.psu.swe.fortress.poc.interceptor;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.enterprise.util.Nonbinding;
import javax.ws.rs.NameBinding;
[Code]...
The output from the debug show that permissions values inside of the ResourceImpl contains the values I'd expect (foo,bar), but inside the interceptor, they're missing. Is there a way to get the arguments in ResourceImpl to pass through to the interceptor?
Log output looks like:
15:59:55,223 INFO [stdout] (default task-9) @edu.psu.swe.fortress.poc.interceptor.FortressProtected(permissions=[])
15:59:55,229 INFO [stdout] (default task-9) @edu.psu.swe.fortress.poc.interceptor.FortressProtected(permissions=[foo, bar])
View Replies
View Related
Apr 14, 2015
I would like set a callback which is invoked when a MenuItem is focussed. Is there a way to do so?
View Replies
View Related
Mar 9, 2015
How to write a program that will verify the correctness of a person`s birth date in java. The birth date is to be typed in by the user. the program should verify the following: Birth date entered should be of type java.util.Date(), Birth date may not be in future, Age may not exceed 110 years.
View Replies
View Related
Apr 10, 2015
I have a JavaFX 8 TableView with multiple columns. The CellValueFactories for the columns are set as:
xxxColumn.setCellValueFactory(new ItemCountFactory(itemName));
where itemName is a String identifying a different item for each column.
ItemCountFactory returns a StringBinding as the cell value, as follows:
public ObservableValue<String> call(CellDataFeatures<Category, String> rowData) {
return new ItemCountBinding(rowData.getValue(), itemName);
}
where
class ItemCountBinding extends StringBinding {
...
protected String computeValue() {
String cellValue = ...;
return cellValue;
}
}
The StringBinding depends on properties of the Category instance for the table row. The correct data is displayed okay, but I have noticed that every time one of the Category properties changes (i.e., every time a cell value changes), ItemCountFactory is called again to create a new StringBinding. I would have expected the Factory to be invoked just once for each cell during initialization, and then the table column would monitor the returned Observable object. Instead it seems to be creating a new Observable object every time the cell value changes. Is this normal, or am I doing something wrong? Same behavior on Java 8u20 and 8u40. If it is not the expected behavior, I will write an example test program; I do not want to post the current full source code.
The table items are set just once, with:
countTable.setItems(categoryList);
where categoryList is of type ObservableList<Category>. The list itself is not modified after being associated with the table; i.e., no rows are added or deleted or replaced.
View Replies
View Related
Oct 12, 2013
I need to process 10000 xml files and verify and insert the data into database. I am loading all the files in the file object and iterating one by one. I am getting the memory issue. How to handle this?
View Replies
View Related