Posts

Showing posts from April, 2017

Featured Post

HTTP web resource protection and login mechanism

<div dir="ltr" style="text-align: left;" trbidi="on"> <div dir="ltr" style="text-align: left;" trbidi="on"> j2ee standard way of protecting resources and login setup as mentioned here    if we don't mention http-method in web.xml all methods will be protected by default . in other words if you mention  <http-method>GET</http-method>, this would protect only GET method for all resources and other methods like PUT,TRACE,HEAD,UPDATE,PATCH and DELETE requests on the resources would not be protected    web.xml   -----------        <security-constraint>            <web-resource-collection>                 <web-resource-name>All Access</web-resource-name>                  <url-pattern>                       ...

soap vs reset in short lines

SOAP REST Supports XML only supports text,json and XML Supports SMTP and HTTP all protocols supports HTTP only Secure as it supports WS-Security as long a it is on wire , secure once delivered not secure Supports ACID and 2phase commit for long lived txns no txn support ACID or two phase commit There are many differences between SOAP and REST web services. The important 10 differences between SOAP and REST are given below: SOAP is a  protocol . REST is an  architectural style . SOAP stands for  Simple Object Access Protocol . REST stands for  REpresentational State Transfer . SOAP  can't use REST  because it is a protocol. REST  can use SOAP  web services because it is a concept and can use any protocol like HTTP, SOAP. SOAP  uses services interfaces to expose the business logic . REST  uses URI to expose business logic . In Java  JAX-WS  is the java API for SOAP web services. In Java  JAX-RS  i...

BlockingQueue

Java BlockingQueue interface is part of java collections framework and it’s primarily used for implementing producer consumer problem. We don’t need to worry about waiting for the space to be available for producer or object to be available for consumer in BlockingQueue because it’s handled by implementation classes of BlockingQueue. Java provides several BlockingQueue implementations such as  ArrayBlockingQueue ,  LinkedBlockingQueue ,  PriorityBlockingQueue ,  SynchronousQueue  etc. While implementing producer consumer problem in BlockingQueue, we will use ArrayBlockingQueue implementation. Following are some important methods you should know.

Java Thread Local

Friends All the threads of Object in java share same variables and  if that variable is not thread safe , we can use  synchronized , we have to handle this situation as multiple threads share same variable. to avoid this either we have to go for synchronization or make the variable ThreadLocal , these variables are private statis and accessible to only that thread . we can provide setter and getter to access this variable. Short Notes : ---------------      " Java ThreadLocal is used to create thread local variables. We know that all threads of an Object share it’s variables, so the variable is not thread safe. We can use synchronization for thread safety but if we want to avoid synchronization, we can use  ThreadLocal  variables."

Mac - remove idk 9

Friends,     As netbeans 8.2 is not working with jdk9 , you might want to remove jdk-9 in Mac laptop     try these steps       sudo rm - rf / Library / Java / JavaVirtualMachines / jdk < version >. jdk sudo rm - rf / Library / PreferencePanes / JavaControlPanel . prefPane sudo rm - rf / Library / Internet \ Plug - Ins / JavaAppletPlugin . plugin sudo rm - rf / Library / LaunchAgents / com . oracle . java . Java - Updater . plist sudo rm - rf / Library / PrivilegedHelperTools / com . oracle . java . JavaUpdateHelper sudo rm - rf / Library / LaunchDaemons / com . oracle . java . Helper - Tool . plist sudo rm - rf / Library / Preferences / com . oracle . java . Helper - Tool . plist