View RSS Feed

All Blog Entries

  1. Passing parameters in RMI

    by
    RMI
    , 01-02-2012 at 06:36 PM
    • By value, primitive types get passed. For example, Boolean, char, int etc.
    • Being remote references, remote object references get passed which permits the client process to make the methods invoked.
    • By object serialization, non remote objects get passed by value. Implementation of the java.io.Serializable interface shall take place which shall allow objects to get serialized.

    Remote method’s invocation gets initiated by the client process, using calling method present ...
    Categories
    Tutorial
  2. Services that are provided by the RMI Object

    by
    RMI
    , 01-02-2012 at 06:35 PM
    Certain basic object services are provided by the RMI that might get utilized on distributed application. Such services include:

    • Object naming/registry service: Services might be provided by the RMI servers to clients by the registration of 1 or more than one remote objects, along with local RMI registry.
    • Object activation service: Based on needs, server objects are provided. With absence of the remote activation service, there exists a need to register the server objects ...
    Categories
    Tutorial
  3. What is a remote object? Why UnicastRemoteObject should be extended?

    by
    RMI
    , 01-02-2012 at 06:34 PM
    Remote object is considered to be the one in which other JVM are used to invoke the methods. Remote interface gets implemented by the remote object class. RMI is that application that produces various remote objects.
    Responsibility of a RMI Server is:
    • To create the remote object’s instance e.g CarImpl instance = new CarImpl()).
    • Export the remote object.
    • Bind the remote object instance to the RMI registry.

    Client’s incoming calls are being accepted ...
    Categories
    Tutorial
  4. RMI Architecture

    by
    RMI
    , 01-02-2012 at 06:31 PM
    RMI or Java Remote Method Invocation gives means to Java program (present at a machine) to do communication with other objects present in other JVMs, address spaces or processes. RMI architecture’s important parts are the skeleton class, stub class and object serialization. Layered architecture is used by the RMI where layers are enhanced without having any affect at the other layers. To summarize the layers, proceed as following:

    • Application Layer: Server program and the client.
    • Stub
    ...
    Categories
    Tutorial
  5. Explain the difference between the look up of “java:comp/env/ejb/MyBean” and “ejb

    by , 01-02-2012 at 06:27 PM
    The alias or logical reference java:comp/env/ejb/MyBean has always been a recommended approach as the physical JNDI location i.e. ejb/MyBean may not be guaranteed that it (specified in the code) will be present. In case the physical location is changed, code will also be broken down. Your code will not be able to get modified by the deployer. This problem is solved by the logical references which bind the logical names in the application server to the physical name. Declaration will be done of ...

    Updated 01-15-2012 at 08:23 AM by JNDI

    Tags: lookup ejb Add / Edit Tags
    Categories
    Tutorial
  6. EJB 3.1 Global JNDI Names

    by , 01-02-2012 at 06:24 PM
    Session beans are registered to JNDI context automatically. Whether through look up or dependency injection, a client obtains the reference towards beans from the JNDI context. Bean registered under a name is basically registered to the JNDI context container and is referred commonly as “the global JNDI name”. Global JNDI names are applied to the session beans which expose the Local views.

    java:global[/<application-name>]/<module-name>/<bean-name>[!<fully qualified ...

    Updated 01-15-2012 at 08:24 AM by JNDI

    Categories
    Tutorial
  7. Locating EJB Home Interface

    by , 01-02-2012 at 06:21 PM
    Home interface of EJB can be located by an EJB client via standard JNDI API. To make available the home interfaces of its deployed beans EJB is considered responsible, using JNDI. JNDI namespace of a client can be configured to consider the EJBs home interfaces which are installed on other hosts or containers.

    Java Code: This is the code to locate EJB Home Interface
    import java.util.Collection;
    import java.util.Iterator;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    ...

    Updated 01-14-2012 at 06:20 PM by JNDI

    Categories
    Tutorial
  8. What is JNDI

    by , 01-02-2012 at 06:19 PM
    Java Naming & Directory Interface gives the generic interface to the Lightweight Directory Access protocol or other director services for example, DNS or NDS. The components of the J2EE application use JNDI interfaces to look up & to refer the user defined and system provided objects in component environment. JNDI is not defined for one specified directory or naming service. Different system kinds may be accessed which also includes the file systems. The JNDI API makes the applications look ...
    Tags: jndi Add / Edit Tags
    Categories
    Tutorial
  9. Business Methods

    by
    EJB
    , 01-02-2012 at 06:06 PM
    Business method or business process is the collection of structured and related tasks which create a certain product for specified customers. Let us now code the business methods for addition/deletion and also for the retrieval of the Book Entity Beans objects.

    Java Code: This is an example of business methods
    import java.util.Collection; 
    import javax.ejb.Stateless; 
    import javax.persistence.EntityManager; 
    import javax.persistence.PersistenceContext; 
    import com.visualbuilder.entity.Book;
    ...

    Updated 01-14-2012 at 06:17 PM by EJB

    Categories
    Tutorial
  10. The lifecycle of stateless bean

    by
    EJB
    , 01-02-2012 at 06:03 PM
    Stateless session bean’s life cycle consists of 2 stages namely; ready for the invocation of the business method and non existent. Client initiates the life cycle by seeking references towards the stateless bean. Dependency injection is performed by the container and then the method annotated @PostConstruct is invoked. Now bean is ready to invoke the business methods by client. Method annotated @PreDestroy is called by the EJB container at the end of life cycle, if any. Then for garbage collection, ...
    Categories
    EJB Bean
  11. Interface and bean-class

    by
    EJB
    , 01-02-2012 at 06:02 PM
    Home interfaces and remote interfaces present the bean however beans are insulated by the container and client application’s direct access. Whenever a bean is deleted, created or requested the whole process is managed by the container.

    Component’s life cycle methods are presented by the home interfaces however bean’s business method is presented by the remote interfaces. Home & remote interfaces extends the javax.ejb.EJBHome interface and javax.ejb.EJBObject interface. Such types ...
    Categories
    Session Bean
  12. When to use Session Beans

    by
    EJB
    , 01-02-2012 at 05:57 PM
    Just one client can access the bean instance at any given time. There exists no persistency in case of state of the bean. They just exist for shorter time duration.

    State full session beans are suitable whenever:

    • The state of bean presents the interaction b/w a specific client and the bean.
    • The bean requires retention of certain information regarding the client, across method invocations.
    • There occurs the mediation b/w other application components and client
    ...
    Tags: session bean Add / Edit Tags
    Categories
    Session Bean , EJB Bean
  13. Stateless Session Bean

    by
    EJB
    , 01-02-2012 at 05:55 PM
    A stateless session (EJB Component) is an enterprise bean which gives its users a stateless service. Interface javax.ejb.SessionBean is implemented by the stateless session bean (EJB Component) and deploys to the “stateless” declarative attribute. They are known as “stateless” as conversational states are not maintained by them that are specific to the client’s session. Stateless session beans are same as the static methods or procedural applications; no instance state is present therefore to execute ...

    Updated 01-14-2012 at 06:14 PM by EJB

    Categories
    Session Bean , EJB Bean
  14. Stateful Session Bean

    by
    EJB
    , 01-02-2012 at 05:52 PM
    A stateful session bean is an enterprise bean (EJB component) that serves to be a client’s server side extension. It is created by one client and hence it works for just that client till the drop takes place in client connection or removal of the bean takes place explicitly. The stateful Bean (EJB Component) implements the interface javax.ejb.SessionBean and deploys to the “stateful” which is the declarative attribute. They are called stateful as conversational state is being maintained by them ...

    Updated 01-14-2012 at 06:12 PM by EJB

    Categories
    Session Bean
  15. What is a Session Bean?

    by
    EJB
    , 01-02-2012 at 05:49 PM
    Inside J2EE server, single client is presented in a session bean. It is considered as a non persistent object which makes the implementation of other business logics that run at server. Session beans are not able to survive the shut down of the system.

    Two types of session beans are there:

    • Stateless session beans (By multiple EJB clients, each session bean could be reused)
    • Stateful session beans (every session bean is linked to just one EJB client)
    Tags: session bean Add / Edit Tags
    Categories
    Session Bean
  16. EJB Container

    by
    EJB
    , 01-02-2012 at 05:48 PM
    The EJB container is an interface b/w enterprise bean which provides the business logic in the Java EE server or a Java EE application. EJB container is run at the Java EE server & it manages the application's enterprise beans execution.

    Name:  26.JPG
Views: 399
Size:  23.8 KB

    EJB Container
    Categories
    EJB Container
  17. When to use / When not EJB

    by
    EJB
    , 01-02-2012 at 05:45 PM
    When to Use EJB
    • Distributed transactions are needed.
    • Component security needed.
    • Persistence needed.
    • Integration along with the legacy applications are needed.
    • Scalability is needed.


    When not use EJB
    • When one doesn’t require application integration, transactions or other infrastructure like facilities in their application.
    Categories
    Tutorial
  18. Advantages/Disadvantages of EJB

    by
    EJB
    , 01-02-2012 at 05:43 PM
    EJB Advantages
    • To access EJB free security is provided.
    • Declarative transactions are provided.
    • EJBs are cached & pooled. Containers manage the EJB life cycles.
    • Remote access capabilities are present & are clustered for sake of scalability.
    • OO concepts are supported for example inheritance.
    • Usage of attributes or annotation based programming is possible.
    • Free usage & access of complex resources


    EJB Disadvantages
    • Complicated and large specification
    • Increased
    ...
  19. EJB Architecture

    by
    EJB
    , 01-01-2012 at 08:57 PM
    Architecture of EJB is given below. 3 kinds of interfaces are exposed by the help of EJB which are as following:
    1. Home interface
    2. Remote interface
    3. JMS Message Listener Interface

    Name:  25.JPG
Views: 1363
Size:  36.1 KB

    EJB Architecture
    Categories
    Tutorial
  20. What is EJB?

    by
    EJB
    , 01-01-2012 at 08:54 PM
    EJB is multi tier system that is distributed & remote. It supports the protocols for example, HTTP, IIOP and JRMP etc. Rapid development of the versatile, reusable and portable business components takes place across the scalable, middle ware and transactional applications. For J2EE servers, EJB is considered as a specification. System level programming and business logic are present in EJB components for example security, threading, transactions, instance pooling, persistence etc which are managed ...

    Updated 01-15-2012 at 07:50 AM by EJB

    Categories
    Tutorial
  21. EJB Architecture

    by
    EJB
    , 01-01-2012 at 08:53 PM
    EJB is multi tier system that is distributed & remote. It supports the protocols for example, HTTP, IIOP and JRMP etc. Rapid development of the versatile, reusable and portable business components takes place across the scalable, middle ware and transactional applications. For J2EE servers, EJB is considered as a specification. System level programming and business logic are present in EJB components for example security, threading, transactions, instance pooling, persistence etc which are managed ...
  22. TagExtraInfo Class

    by
    JSP
    , 01-01-2012 at 06:26 PM
    A TagExtraInfo class gives out certain extra data or information regarding the attributes of tags to the JSP container, at translation time.

    • Returns information or data regarding the scripting variables which is made available by the tag to the remaining JSP page for use. Following method is used.

    Java Code:
    VariableInfo[] getVariableInfo(TagData td)
    
    <html>
    <myTag:addObjectsToArray name=”myArray” />
    <myTag:displayArray name=”myArray”
    ...

    Updated 01-14-2012 at 06:08 PM by JSP

    Categories
    Uncategorized
  23. JSP URL Mapping

    by
    JSP
    , 01-01-2012 at 06:23 PM
    Given in the figure below JSP resources reside under subdirectories or directly there in the document root that are accessible directly to users via URL. In order to protect the web resources, behind WEB-INF directory hide the JSP files that provide protection to JSP files, Java Script files, image files, css files (cascading style sheets), pdf files, html files etc, from the direct access. To servlet, a request shall be made as it is responsible for the authorization as well as authentication of ...

    Updated 01-15-2012 at 07:41 AM by JSP

    Categories
    URL Mapping
  24. Is JSP variable declaration thread safe?

    by
    JSP
    , 01-01-2012 at 06:20 PM
    No, in JSP the variable declaration is not at all thread safe as the declared variables are ended up as instance variable in generated servlet not in body of _jspservice() method.

    The given declaration is not considered to be thread safe: as they are declarations and are evaluated only one time when page gets loaded.

    <%!int a=5;%>

    The given declaration is considered thread safe: as in the scriplets the variables that have been declared are not shared ...
  25. Hidden and Output Comments

    by
    JSP
    , 01-01-2012 at 06:00 PM
    An output comment is sent to the client where it becomes viewable in the source of browser.

    <!-- This is a comment which is sent to client -->

    JSP page is documented by hidden comment however it is not sent to client. Hidden comment is ignored by the JSP engine and no code is processed in tags of the hidden comments.

    <%-- This comment will not be visible to client --%>

    Updated 01-15-2012 at 07:43 AM by JSP

    Categories
    Comment
  26. Implicit Objects

    by
    JSP
    , 01-01-2012 at 05:56 PM
    Implicit objects are those objects which are present to be used in the JSP documents without declaration. JSP engine parses such objects and are inserted to the generate servlet. Following are the servlet objects:

    Name:  18.JPG
Views: 788
Size:  33.4 KB
    Implicit Objects
  27. Main elements of a JSP

    by
    JSP
    , 01-01-2012 at 05:54 PM
    In a JSP page, two types of data are present.

    • Static part (ie CSS, HTML etc), that is copied to the response directly by the JSP Engine.
    • Dynamic part that consists of anything which can be compiled and translated by the JSP Engine.

    Dynamic elements consist of 3 elements.

    • Scripting Elements: A JSP element which gives out the embedded Java statements. Three kinds of scripting elements are present.

    o Declaration Element: is
    ...

    Updated 01-14-2012 at 06:04 PM by JSP

    Categories
    Tutorial
  28. Life cycle methods of a JSP

    by
    JSP
    , 01-01-2012 at 05:47 PM
    • Pre-translated: Before the JSP file is compiled or translated, into the Servlet.
    • Translated: The JSP file is being compiled & translated as a Servlet.
    • Initialized: Before handling requests of service method, the container calls the jspInit() to do the initialization of the Servlet. Called just one time per Servlet instance.
    • Servicing: client requests are served. For each request, container calls it.
    • Out of service: The Servlet instances are out of their services. The container calls
    ...
  29. What is JSP?

    by
    JSP
    , 01-01-2012 at 05:45 PM
    Java Servlet technology’s extension is Java ServerPages. JSP is used as presentation layer to combine the Java code and HTML. Java Servlet technology generates HTML along with out.println(“<html>….. </html>”) statements (out is PrintWriter). Embedding HTML code to the escape characters is a process which is hardly maintained and is cumbersome. A level of abstraction is provided by the JSP technology in order to enable a developer to use the action elements and custom tags. This makes ...
  30. Cookies

    by , 01-01-2012 at 04:08 PM
    A cookie is that test of piece which can be stored on the hard disk of a user by web server. Information is being stored on user machine by the help of cookies which is later retrieved. Such information pieces are stored as “name value pairs”. Cookie data gets moved in this way:

    • If URL of a site is typed in the browser, browser will be sending its requests to web server. When this is done by the web browser cookie file is looked for at the machine which has been set by the URL. ...
    Categories
    Cookies
Page 28 of 48 FirstFirst ... 18262728293038 ... LastLast