锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产高清aⅴ视频,亚洲精品自拍偷拍,天堂综合在线播放http://www.aygfsteel.com/SunRiver/category/15312.htmlTopics about Java EE, XML,AJAX,SOA,OSGi,DB, .NET etc.zh-cnMon, 16 Jul 2007 11:42:35 GMTMon, 16 Jul 2007 11:42:35 GMT60J2EE Faqshttp://www.aygfsteel.com/SunRiver/archive/2007/07/13/129968.htmlSun RiverSun RiverThu, 12 Jul 2007 20:48:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2007/07/13/129968.htmlWhat is the difference between Session bean and Entity bean ? The Session bean and Entity bean are two main parts of EJB container. Session Bean --represents a workflow on behalf of a client --one-to-one logical mapping to a client. --created and destroyed by a client --not permanent objects --lives its EJB container(generally) does not survive system shut down --two types: stateless and stateful beans Entity Bean --represents persistent data and behavior of this data --can be shared among multiple clients --persists across multiple invocations --findable permanent objects --outlives its EJB container, survives system shutdown --two types: container managed persistence(CMP) and bean managed persistence(BMP)
--What is reentrant entity bean ? An entity bean that can handle multiple simultaneous, interleaved, or nested invocations that will not interfere with each other. --What is JMS session ? A single-threaded context for sending and receiving JMS messages. A JMS session can be nontransacted, locally transacted, or participating in a distributed transaction. ---Can you make use of a ServletOutputStream object from within a JSP page? No. You are supposed to make use of only a JSPWriter object (given to you in the form of the implicit object out) for replying to clients. A JSPWriter can be viewed as a buffered version of the stream object returned by response.getWriter(), although from an implementational perspective, it is not.
---What are the core JMS-related objects required for each JMS-enabled application? Each JMS-enabled client must establish the following: * A connection object provided by the JMS server (the message broker) * Within a connection, one or more sessions, which provide a context for message sending and receiving * Within a session, either a queue or topic object representing the destination (the message staging area) within the message broker * Within a session, the appropriate sender or publisher or receiver or subscriber object (depending on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, respectively). Within a session, a message object (to send or to receive)
How does the Application server handle the JMS Connection? 1. App server creates the server session and stores them in a pool. 2. Connection consumer uses the server session to put messages in the session of the JMS. 3. Server session is the one that spawns the JMS session. 4. Applications written by Application programmers creates the message listener.
What is Stream Message ? Stream messages are a group of java primitives. It contains some convenient methods for reading the data. However Stream Message prevents reading a long value as short. This is so because the Stream Message also writes the type information along with the value of the primitive type and enforces a set of strict conversion rules which actually prevents reading of one primitive type as another. --
Why do the JMS dbms_aqadm.add_subscriber and dbms_aqadm.remove_subscriber calls sometimes hang when there are concurrent enqueues or dequeues happening on the same queue to which these calls are issued? Add_subscriber and remove_subscriber are administrative operations on a queue. Though AQ does not prevent applications from issuing administrative and operational calls concurrently, they are executed serially. Both add_subscriber and remove_subscriber will block until pending transactions that have enqueued or dequeued messages commit and release the resources they hold. It is expected that adding and removing subscribers will not be a frequent event. It will mostly be part of the setup for the application. The behavior you observe will be acceptable in most cases. The solution is to try to isolate the calls to add_subscriber and remove_subscriber at the setup or cleanup phase when there are no other operations happening on the queue. That will make sure that they will not stay blocked waiting for operational calls to release resources.
Why do the TopicSession.createDurableSubscriber and TopicSession.unubscribe calls raise JMSException with the message "ORA - 4020 - deadlock detected while trying to lock object"? CreateDurableSubscriber and unsubscribe calls require exclusive access to the Topics. If there are pending JMS operations (send/publish/receive) on the same Topic before these calls are issued, the ORA - 4020 exception is raised. There are two solutions to the problem: 1. Try to isolate the calls to createDurableSubscriber and unsubscribe at the setup or cleanup phase when there are no other JMS operations happening on the Topic. That will make sure that the required resources are not held by other JMS operational calls. Hence the error ORA - 4020 will not be raised. 2. Issue a TopicSession.commit call before calling createDurableSubscriber and unsubscribe call.
Why doesn't AQ_ADMINISTRATOR_ROLE or AQ_USER_ROLE always work for AQ applications using Java/JMS API? In addition to granting the roles, you would also need to grant execute to the user on the following packages: * grant execute on sys.dbms_aqin to <userid> * grant execute on sys.dbms_aqjms to <userid>
Why do I get java.security.AccessControlException when using JMS MessageListeners from Java stored procedures inside Oracle8i JServer? To use MessageListeners inside Oracle8i JServer, you can do one for the following 1. GRANT JAVASYSPRIV to <userid>
What is the use of ObjectMessage? ObjectMessage contains a Serializable java object as it's payload. Thus it allows exchange of Java objects between applications. This in itself mandates that both the applications be Java applications. The consumer of the message must typecast the object received to it's appropriate type. Thus the consumer should before hand know the actual type of the object sent by the sender. Wrong type casting would result in ClassCastException. Moreover the class definition of the object set in the payload should be available on both the machine, the sender as well as the consumer. If the class definition is not available in the consumer machine, an attempt to type cast would result in ClassNotFoundException. Some of the MOMs might support dynamic loading of the desired class over the network, but the JMS specification does not mandate this behavior and would be a value added service if provided by your vendor. And relying on any such vendor specific functionality would hamper the portability of your application. Most of the time the class need to be put in the classpath of both, the sender and the consumer, manually by the developer.
What is the use of MapMessage? A MapMessage carries name-value pair as it's payload. Thus it's payload is similar to the java.util.Properties object of Java. The values can be Java primitives or their wrappers.
What is the difference between BytesMessage and StreamMessage? BytesMessage stores the primitive data types by converting them to their byte representation. Thus the message is one contiguous stream of bytes. While the StreamMessage maintains a boundary between the different data types stored because it also stores the type information along with the value of the primitive being stored. BytesMessage allows data to be read using any type. Thus even if your payload contains a long value, you can invoke a method to read a short and it will return you something. It will not give you a semantically correct data but the call will succeed in reading the first two bytes of data. This is strictly prohibited in the StreamMessage. It maintains the type information of the data being stored and enforces strict conversion rules on the data being read.
What is object message ? Object message contains a group of serializeable java object. So it allows exchange of Java objects between applications. sot both the applications must be Java applications.
What is text message? Text messages contains String messages (since being widely used, a separate messaging Type has been supported) . It is useful for exchanging textual data and complex character data like XML.
What is Map message? map message contains name value Pairs. The values can be of type primitives and its wrappers. The name is a string.
---Does JMS specification define transactions? Queue JMS specification defines a transaction mechanisms allowing clients to send and receive groups of logically bounded messages as a single unit of information. A Session may be marked as transacted. It means that all messages sent in a session are considered as parts of a transaction. A set of messages can be committed (commit() method) or rolled back (rollback() method). If a provider supports distributed transactions, it's recommended to use XAResource API. ---
Does JMS specification define transactions? Queue JMS specification defines a transaction mechanisms allowing clients to send and receive groups of logically bounded messages as a single unit of information. A Session may be marked as transacted. It means that all messages sent in a session are considered as parts of a transaction. A set of messages can be committed (commit() method) or rolled back (rollback() method). If a provider supports distributed transactions, it's recommended to use XAResource API.
]]> Message-Driven Beanhttp://www.aygfsteel.com/SunRiver/archive/2007/07/09/129035.htmlSun RiverSun RiverMon, 09 Jul 2007 06:35:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2007/07/09/129035.htmlmessage-driven bean is an enterprise bean that allows J2EE applications to process messages asynchronously. It acts as a JMS message listener, which is similar to an event listener except that it receives messages instead of events. Message-driven beans currently process only JMS messages, but in the future they may be used to process other kinds of messages. The most visible difference between message-driven beans and session and entity beans is that clients do not access message-driven beans through interfaces.
When a message arrives, the container calls the message-driven bean's onMessage method to process the message. The onMessage method normally casts the message to one of the five JMS message types and handles it in accordance with the application's business logic. The onMessage method may call helper methods, or it may invoke a session or entity bean to process the information in the message or to store it in a database.
A message may be delivered to a message-driven bean within a transaction context, so that all operations within the onMessage method are part of a single transaction. If message processing is rolled back, the message will be redelivered. Session beans and entity beans allow you to send JMS messages and to receive them synchronously, but not asynchronously. To avoid tying up server resources, you may prefer not to use blocking synchronous receives in a server-side component. To receive messages asynchronously, use a message-driven bean.
]]>Tough interview questions on EJBhttp://www.aygfsteel.com/SunRiver/archive/2006/12/18/88615.htmlSun RiverSun RiverMon, 18 Dec 2006 11:28:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2006/12/18/88615.html
How EJB Invocation happens? - Retrieve Home Object reference from Naming Service via JNDI. Return Home Object reference to the client. Create me a new EJB Object through Home Object interface. Create EJB Object from the Ejb Object. Return EJB Object reference to the client. Invoke business method using EJB Object reference. Delegate request to Bean (Enterprise Bean).
Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB? - You can pass the HttpSession as parameter to an EJB method, only if all objects in session are serializable.This has to be consider as passed-by-value, that means that it鈥檚 read-only in the EJB. If anything is altered from inside the EJB, it won鈥檛 be reflected back to the HttpSession of the Servlet Container.The pass-by-reference can be used between EJBs Remote Interfaces, as they are remote references. While it is possible to pass an HttpSession as a parameter to an EJB object, it is considered to be bad practice in terms of object-oriented design. This is because you are creating an unnecessary coupling between back-end objects (EJBs) and front-end objects (HttpSession). Create a higher-level of abstraction for your EJBs API. Rather than passing the whole, fat, HttpSession (which carries with it a bunch of http semantics), create a class that acts as a value object (or structure) that holds all the data you need to pass back and forth between front-end/back-end. Consider the case where your EJB needs to support a non HTTP-based client. This higher level of abstraction will be flexible enough to support it.
The EJB container implements the EJBHome and EJBObject classes. For every request from a unique client, does the container create a separate instance of the generated EJBHome and EJBObject classes? - The EJB container maintains an instance pool. The container uses these instances for the EJB Home reference irrespective of the client request. while refering the EJB Object classes the container creates a separate instance for each client request. The instance pool maintenance is up to the implementation of the container. If the container provides one, it is available otherwise it is not mandatory for the provider to implement it. Having said that, yes most of the container providers implement the pooling functionality to increase the performance of the application server. The way it is implemented is, again, up to the implementer.
Can the primary key in the entity bean be a Java primitive type such as int? - The primary key can鈥檛 be a primitive type. Use the primitive wrapper classes, instead. For example, you can use java.lang.Integer as the primary key class, but not int (it has to be a class, not a primitive).
Can you control when passivation occurs? - The developer, according to the specification, cannot directly control when passivation occurs. Although for Stateful Session Beans, the container cannot passivate an instance that is inside a transaction. So using transactions can be a a strategy to control passivation. The ejbPassivate() method is called during passivation, so the developer has control over what to do during this exercise and can implement the require optimized logic. Some EJB containers, such as BEA WebLogic, provide the ability to tune the container to minimize passivation calls. Taken from the WebLogic 6.0 DTD -鈥漈he passivation-strategy can be either 鈥渄efault鈥?or 鈥渢ransaction鈥? With the default setting the container will attempt to keep a working set of beans in the cache. With the 鈥渢ransaction鈥?setting, the container will passivate the bean after every transaction (or method call for a non-transactional invocation).
What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other? - Entity Beans actually represents the data in a database. It is not that Entity Beans replaces JDBC API. There are two types of Entity Beans Container Managed and Bean Mananged. In Container Managed Entity Bean - Whenever the instance of the bean is created the container automatically retrieves the data from the DB/Persistance storage and assigns to the object variables in bean for user to manipulate or use them. For this the developer needs to map the fields in the database to the variables in deployment descriptor files (which varies for each vendor). In the Bean Managed Entity Bean - The developer has to specifically make connection, retrive values, assign them to the objects in the ejbLoad() which will be called by the container when it instatiates a bean object. Similarly in the ejbStore() the container saves the object values back the the persistance storage. ejbLoad and ejbStore are callback methods and can be only invoked by the container. Apart from this, when you use Entity beans you dont need to worry about database transaction handling, database connection pooling etc. which are taken care by the ejb container.
What is EJB QL? - EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence. EJB QL is introduced in the EJB 2.0 specification. The EJB QL query language defines finder methods for entity beans with container managed persistenceand is portable across containers and persistence managers. EJB QL is used for queries of two types of finder methods: Finder methods that are defined in the home interface of an entity bean and which return entity objects. Select methods, which are not exposed to the client, but which are used by the Bean Provider to select persistent values that are maintained by the Persistence Manager or to select entity objects that are related to the entity bean on which the query is defined.
Brief description about local interfaces? - EEJB was originally designed around remote invocation using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard CORBA transport for these calls using RMI/IIOP. This design allowed for maximum flexibility in developing applications without consideration for the deployment scenario, and was a strong feature in support of a goal of component reuse in J2EE. Many developers are using EJBs locally, that is, some or all of their EJB calls are between beans in a single container. With this feedback in mind, the EJB 2.0 expert group has created a local interface mechanism. The local interface may be defined for a bean during development, to allow streamlined calls to the bean if a caller is in the same container. This does not involve the overhead involved with RMI like marshalling etc. This facility will thus improve the performance of applications in which co-location is planned. Local interfaces also provide the foundation for container-managed relationships among entity beans with container-managed persistence.
What are the special design care that must be taken when you work with local interfaces? - It is important to understand that the calling semantics of local interfaces are different from those of remote interfaces. For example, remote interfaces pass parameters using call-by-value semantics, while local interfaces use call-by-reference. This means that in order to use local interfaces safely, application developers need to carefully consider potential deployment scenarios up front, then decide which interfaces can be local and which remote, and finally, develop the application code with these choices in mind. While EJB 2.0 local interfaces are extremely useful in some situations, the long-term costs of these choices, especially when changing requirements and component reuse are taken into account, need to be factored into the design decision.
What happens if remove( ) is never invoked on a session bean? - In case of a stateless session bean it may not matter if we call or not as in both cases nothing is done. The number of beans in cache is managed by the container. In case of stateful session bean, the bean may be kept in cache till either the session times out, in which case the bean is removed or when there is a requirement for memory in which case the data is cached and the bean is sent to free pool.
What is the difference between Message Driven Beans and Stateless Session beans? - In several ways, the dynamic creation and allocation of message-driven bean instances mimics the behavior of stateless session EJB instances, which exist only for the duration of a particular method call. However, message-driven beans are different from stateless session EJBs (and other types of EJBs) in several significant ways: Message-driven beans process multiple JMS messages asynchronously, rather than processing a serialized sequence of method calls. Message-driven beans have no home or remote interface, and therefore cannot be directly accessed by internal or external clients. Clients interact with message-driven beans only indirectly, by sending a message to a JMS Queue or Topic. Only the container directly interacts with a message-driven bean by creating bean instances and passing JMS messages to those instances as necessary. The Container maintains the entire lifecycle of a message-driven bean; instances cannot be created or removed as a result of client requests or other API calls.
How can I call one EJB from inside of another EJB? - EJBs can be clients of other EJBs. It just works. Use JNDI to locate the Home Interface of the other bean, then acquire an instance reference, and so forth.
What is an EJB Context? - EJBContext is an interface that is implemented by the container, and it is also a part of the bean-container contract. Entity beans use a subclass of EJBContext called EntityContext. Session beans use a subclass called SessionContext. These EJBContext objects provide the bean class with information about its container, the client using the bean and the bean itself. They also provide other functions. See the API docs and the spec for more details.
]]>2006.11.21 J2EE Testhttp://www.aygfsteel.com/SunRiver/archive/2006/11/22/82685.htmlSun RiverSun RiverWed, 22 Nov 2006 01:52:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2006/11/22/82685.html2. what is manditory parts of EJB? 3. What is 4 transaction isolation levels of JDBC? 4. Explain dirty read, nonrepeatable read and phantom read? 5. Give the steps using websphere to develop the ejb application (code change, ejb deploy, servlet etc.) 6. Give the architecture of a SOA application and explain every parts 7. What is聽JSP model 1 and model 2? 8. Explain the connection pooling
]]>About DD authentificationhttp://www.aygfsteel.com/SunRiver/archive/2006/10/10/74204.htmlSun RiverSun RiverMon, 09 Oct 2006 17:55:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2006/10/10/74204.html
Web Application Login Authentication
None
Select when no authentication is desired.
HTTP Basic Authentication (RFC 2617)
Select to specify browser authentication.
Realm
Enter the realm string. The web server then authenticates the user in the specified realm.
HTTP Digest Authentication (RFC 2617)
Select to specify digest authentication.
Form-based Authentication
Select to specify user-written HTML form for authentication.
Login Page
Enter an HTML page, JSP page, or HTTP servlet that is used to authenticate the user. The page must return an HTML page containing a FORM that conforms to a specific naming convention. This is done through the <form-login-config> tag in the <login-config> subelement of the generated web.xml file.
Error Page
Enter an HTML page that is sent to a user when authentication fails. This page contains information about the connection failure.
Provides the means for dynamically plugging in support for accessing naming and directory services through the javax.naming and related packages.(Service Provider Interface)