The largest Interview Solution Library on the web


Interview Questions
« Previous | 0 | 1 | 2 | 3 | 4 | Next »

21.17.2. Configure the Java Connector Architecture (JCA) Subsystem?

The JCA subsystem in the JBoss Enterprise Application Platform 6 configuration file controls the general settings for the JCA container and resource adapter deployments.
Key elements of the JCA subsystem
Archive validation
This setting whether archive validation will be performed on the deployment units.
The following table describes the attributes you can set for archive validation.

22.Table 17.1. Archive validation attributes?

AttributeDefault ValueDescription
enabledtrueSpecifies whether archive validation is enabled.
fail-on-errortrueSpecifies whether an archive validation error report fails the deployment.
fail-on-warnfalseSpecifies whether an archive validation warning report fails the deployment.
If an archive does not implement the Java EE Connector Architecture specification correctly and archive validation is enabled, an error message will display during deployment describing the problem. For example:
Severity: ERROR
Section: 19.4.2
Description: A ResourceAdapter must implement a "public int hashCode()" method.
Code: com.mycompany.myproject.ResourceAdapterImpl

Severity: ERROR
Section: 19.4.2
Description: A ResourceAdapter must implement a "public boolean equals(Object)" method.
Code: com.mycompany.myproject.ResourceAdapterImpl
If archive validation is not specifed, it is considered present and the enabled attribute defaults to true.

23.What is Bean validation?

This setting determines whether bean validation (JSR-303) will be performed on the deployment units.
The following table describes the attributes you can set for bean validation.

24.Table 17.2. Bean validation attributes?

AttributeDefault ValueDescription
enabledtrueSpecifies whether bean validation is enabled.
If bean validation is not specifed, it is considered present and the enabled attribute defaults to true.

25.What is Table 17.3. Work manager attributes?

AttributeDescription
nameSpecifies the name of the work manager. This is required for custom work managers.
short-running-threadsThread pool for standard Work instances. Each work manager has one
sshort-running thread pool.
long-running-threadsThread pool for JCA 1.6 Work instances that set the LONG_RUNNING hint. Each work manager can have one optional long-running thread pool.

26.What is Table 17.4. Thread pool attributes?

AttributeDescription
allow-core-timeoutBoolean setting that determines whether core threads may time out. The default value is false.
core-threadsThe core thread pool size. This must be smaller than the maximum thread pool size.
queue-lengthThe maximum queue length.
max-threadThe maximum thread pool size.
keepalive-timeSpecifies the amount of time that pool threads should be kept after doing work.
thread-factoryReference to the thread factory .

27.What is Bootstrap contexts?

Used to define custom bootstrap contexts.
The following table describes the attributes you can set for bootstrap contexts.

28.What is Table 17.5. Bootstrap context attributes?

AttributeDescription
nameSpecifies the name of the bootstrap context.
workmanagerSpecifies the name of the work manager to use for this context.

29.What is Cached connection manager

Used for debugging connections and supporting lazy enlistment of a connection in a transaction, tracking whether they are used and released properly by the application.

30.What is Table 17.6. Cached connection manager attributes?

Throws exception on failure to explicitly close connections.
AttributeDefault ValueDescription
debugfalseOutputs warning on failure to explicity close connections.
errorfalse

31.What is Procedure 17.1. Configure the JCA subsystem using the Management Console?

The JCA subsystem of JBoss Enterprise Application Platform 6 can be configured in the Management Console. The JCA configuration options are located in slightly different places in the Management Console depending on how the server is being run.

If the server is running as a Standalone Server, follow these steps:

Click on the Profile link on the top right to switch to the Profile view.

Ensure the Profile section in the navigation panel to the left is expanded.

Click on Connector to expand it, and then click on JCA.

If the server is running as part of a Managed Domain, follow these steps:

Click on the Profile link on the top right to switch to the Profile view

Select the profile you are modifying from the Profile menu at the top of the navigation panel on the left.

Click on Connector to expand it, and then click on JCA.

Configure the settings for the JCA subsystem using the three tabs.

32.What is Common Config?

The Common Config tab contains settings for the cached connection manager, archive validation and bean validation ((JSR-303). Each of these is contained in their own tab as well. These settings can be changed by opening the appropriate tab, clicking the edit button, making the required changes, and then clicking on the save button.

33.What is Work Managers?

The Work Manager tab contains the list of configured Work Managers. New Work Managers can be added, removed, and their thread pools configured here. Each Work Manager can have one short-running thread pool and an optional long-running thread pool.

34.What is Bootstrap Contexts?

The Bootstrap Contexts tab contains the list of configured Bootstrap Contexts. New Bootstrap Context objects can be added, removed, and configured. Each Bootstrap Context must be assigned a Work Manager.

35.Figure 17.4. Bootstrap Contexts?

Java Connector Architecture (JCA) 1.6 connectors. As Simple as Possible.
Work Manager:

  • A JCA 1.6 compliant Executor implementation
  • 2 API classes
  • 5 Implementation classes
  • No XML deployment descriptors
  • Maven 3 Build
  • Sample use:
@Stateless
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class ThreadsResource {

@Resource(name="jca/workmanager")
WorkExecutorFactory executorFactory;

public String threads(){
try(WorkExecutor executor = executorFactory.newExecutor();){
Runnable runnable = new Runnable(){
@Override
public void run() {
//some work to do
}
};
executor.execute(runnable);
}
Transactional File Access:
  • A JCA 1.6 compliant File IO implementation
  • 2 API classes
  • 5 Implementation classes
  • No XML deployment descriptors
  • Maven 3 Build
  • Sample use:
import java.net.URI;
import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.connectorz.files.Bucket;
import org.connectorz.files.BucketStore;

@Path("files")
@Stateless
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
public class FilesResource {

@Resource(name = "jca/files")
BucketStore bucketStore;

@PUT
@Path("{id}")
public Response put(@PathParam("id") String id, String content) {
try (Bucket bucket = bucketStore.getBucket();) {
bucket.write(id, content.getBytes());
}
URI createdURI = URI.create(id);
return Response.created(createdURI).build();
}

@GET
@Path("{id}")
public String fetch(@PathParam("id") String id) {
try (Bucket bucket = bucketStore.getBucket();) {
final byte[] content = bucket.fetch(id);
if(content == null)
return null;
return new String(content);
}
}

@DELETE
@Path("{id}")
public void delete(@PathParam("id") String id) {
try (Bucket bucket = bucketStore.getBucket();) {
bucket.delete(id);
}
}
}

36.?

37.?

38.?

39.?

40.?

« Previous | 0 | 1 | 2 | 3 | 4 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com