Saturday, October 17, 2015

Interview Question

difference between abstract and interface
How to save transient data
why externalisation when serializable exists
Internal implementation of hash map and hashset
Normalisation why it is required
explain 1st 2nd 3rd normal form
How to get thread result back - through callable interface
are serialised and deserialised object are the same object instances ?
Read about serialisation in one file and in multiple files and see the heap space .
Answer is No if heap spaces are different.
How to validate JSON
What is difference between merge and inverse
Object state in hibernate
would there be several instances of singleton class in different JVM
// yes different JVM have different class loader hence different objects would get instantiated.
--------------------------------------------------------
when to use second level cache in Hibernate 
Why criteria API are used ? - For dynamic invocation of query parameters. 
What are projections ? aggregate funcations
What are restrictions? where conditions 
QBE ? by passing dummy object in criteria
One To Many // give an example
Many To one // give an example
Hibernate Validator pattern 

------------------------
ThreadLocal usage


http://examples.javacodegeeks.com/enterprise-java/rest/jersey/jax-rs-queryparam-example/



Saturday, September 26, 2015

SOAP over JMS

SOAP webservices can be accessed through HTTP  as well as JMS .
SOAP over JMS  gives message delivery guarantee and is  preferred where  message critical application  are deployed.


JMS provide two types of message communication


1) point to point
    (A) once message is received it is removed from Q
    (B) only one receiver can receive the message
2) publish / subscribe
    (A) message stays on topic even after one receiver reads it
    (B) multiple receivers can subscribe to same topic 




JMS webservices can be  developed  with two approaches


1) 1 way request
- web client will get unblock once  the request is  gone to destination  (Q/Topic)
- Q/Topic both can implement it
2) request - response
- web client will get unblock only after response gets back to the client
-Only Q can implement this type of web service



Friday, June 19, 2015

Clean previous installation of windows files and folders

Start -> Accessories -> System -> Disk Clean up -> clean up previous installtions -> ok. 

Tuesday, June 9, 2015

How to install unrar and rar facilities in mac

1) Download unrar  utility from RARLab
2) extract it through tar -xvf 
3) go inside extracted rar folder 
4) sudo install -c -o $USER rar /usr/local/bin
5) sudo install -c -o $USER unrar /usr/local/bin
6) hit enter and it will ask you for password .
7) u can use unrar and rar utilities in mac.

Thursday, June 4, 2015

How to Load SSL certificate in trustStore

Here is the code >>


static public void doTrustToCertificates(String certPath, String keyPath) throws Exception {

   try{


         char[] password = "changeit".toCharArray();

         String alias = "isskey";


         KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());

         keystore.load(null, password);


         CertificateFactory cf = CertificateFactory.getInstance("X.509");

          InputStream certstream = fullStream (certPath);

          Certificate certs = cf.generateCertificate(certstream);

          File keystoreFile = new File(keyPath);

           // Add the certificate

          keystore.setCertificateEntry(alias, certs);

          // Save the new keystore contents

           FileOutputStream out = new FileOutputStream(keystoreFile);

           keystore.store(out, password);

           out.close();



}catch(Exception ex)

{
          ex.printStackTrace();

}


}



private static InputStream fullStream ( String fname ) throws IOException {

                  FileInputStream fis = new FileInputStream(fname);

                  DataInputStream dis = new DataInputStream(fis);

                  byte[] bytes = new byte[dis.available()];

                  dis.readFully(bytes);

                  ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

                  return bais;

}

}