Nov 24, 2013

Transaction Boundaries and Rollbacks in Oracle SOA Suite

Maintaining Transactions and Rollbacks in BPEL composites are crucial in Distributed and Enterprise environments.

You can find the Presentation of implementing Transactions and Rollbacks by Ron Pinkerton  HERE.




Nov 11, 2013

WLST Scripts to manage OSB configuration.

WebLogic uses the WLST build on Python and Jython for getting tasks programmatically standardized and, if necessary, automated.
Just as the MBeans in a standard WebLogic Domain, Oracle Service Bus uses its own MBeans on top of it. You can use this to request specific information about the configuration, resources such as proxy and business services. You also can export and import a certain configuration like you do in the Service Bus Console.
When you want to create a WLST script for some purpose, the following MBeans are the most important to start with:
  • SessionManagementBean: Used to create, save or discard a session, the same way as in the console. For doing this you can use the following methods:
createSession() 
- Creates the session ( can also be multiple )
activateSession()
- Commit your changes
discardSession()
- Rollback your changes before activate
sessionExists()
- Exit when actions are done or rollbacked.
These actions younormally do in the console using these buttons:
changecenter1
  • ALSBConfgurationMBean: For the import and export of OSB configurations, updating specific information such as endpoint URI’s, and investigate configurations and resources. With this MBean you can manage your OSB configuration, which, packaged in a JAR file, can be Proxy and BusinessServices, WSDL’s or other resources.
  • ServiceDomainMBean: This MBean finds any service enabled for monitoring, and get or reset statistics for services which are enabled for monitoring.

When you start WLST, standard WebLogic modules are loaded but specific OSB you should import in your script to use are:
from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
from com.bea.wli.monitoring import ServiceDomainMBean
to be found in com.bea.common.configfwk_1.5.0.0.jar, sb-kernel-api.jar and sb-kernel-impl.jar in your OSB library home.
Creating the session:
sessionManager = findService(SessionManagementMBean.NAME, SessionManagementMBean.TYPE)
sessionManager.createSession(sessionName)
Then do some stuff….
And save the session or discard when something went wrong:
# Activate the change session
print 'Activating my session...'
sessionManager.activateSession(sessionName, 'Doing stuff session activated')
except:
if sessionManager != None:
sessionManager.discardSession(sessionName)
raise
Use of resource references
For the identification of projects, folders and other resources you can use the Ref() class, and you will use it with the ALSBConfgurationMBean. You can create, delete or export projects and folders with the following methods:
    • createProject(Ref project, String Description)
    • createFolder(Ref folder, String Description)
    • delete() like a collection of references
    • importUploaded(ALSBImportPlan plan) to implement a customization plan
    • Customize(List customizations) - Change environment values with Customization plans, for changing different kind of Env Values, such as Assign, Find & Replace and Reference Mapping
    • ExportProjects(Collection Refs, String ….
Normally it’s done through this section in the sbconsole:
changecenter2
Below you see a snippet of how to import a Customization (with the customization stored in an XML file):

from com.bea.wli.sb.management.configuration import SessionManagementMBean
from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
from com.bea.wli.config import Ref ..
sessionName = createSessionName()
print 'Created session', sessionName
SessionMBean = getSessionMBean(sessionName)
print 'SessionMBean started session'
ALSBConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
print "ALSBConfiguration MBean found", ALSBConfigurationMBean
#customize if a customization file is specified
#affects only the created resources
if customFile != None :
print 'Loading customization File', customFile
iStream = FileInputStream(customFile)
customizationList = Customization.fromXML(iStream)
for customization in customizationList:
print '\n customization', customization.getDescription()
print customizationList.size()
ALSBConfigurationMBean.customize(customizationList)
print 'Customization applied'
SessionMBean.commitSession(sessionName)
print 'session committed'
except:
print "Unexpected error:", sys.exc_info()[0]
if SessionMBean != None:
SessionMBean.discardSession(sessionName)
raise
… and so on.

ServiceDomainMBean
Through this interface you can get loads of statistics of your services. Some of the methods to use are:
  • getMonitoredBusinessServiceRefs() and getMonitoredProxyServiceRefs for determining which services are enabled for monitoring
  • getBusinessServiceStatistics() and getProxyServiceStatistics() gives back runtime statistics collected. You can specify a server name, or get back cluster wide statistics from an aggregated view of statistics of all managed servers).
A short sample below:
stats = cmo.getProxyServiceStatistics([ref],ResourceType.SERVICE.value(),'')
for ps in stats[ref].getAllResourceStatistics():
for s in ps.getStatistics():
if s.getType() == StatisticType.COUNT:
print s.getName() + "("+ str(s.getType()) +"): " + str(s.getCount())
if s.getType() == StatisticType.INTERVAL:
print ( s.getName() + "("+ str(s.getType()) +"): " + str(s.getMin()) + " " + str(s.getMax()) + " " + str(s.getAverage()) + " " + str(s.getSum())
if s.getType() == StatisticType.STATUS:
print s.getName() + "("+ str(s.getType()) +"): " + str(s.getCurrentStatus()) + "(" + str(s.getInitialStatus()) + ")"



Nov 1, 2013

OSB-REST(Creating a RESTful gateway in OSB)

Creating a RESTful gateway in OSB

http://www.youtube.com/v/TvIqpBjSsE4?version=3&autohide=1&feature=share&autoplay=1&attribution_tag=cM3RMqvWMM7ksYAdRTu9qQ&showinfo=1&autohide=1