gpf dev weblogic domain structure

15

Upload: vondra

Post on 19-Jan-2016

52 views

Category:

Documents


5 download

DESCRIPTION

Admin Server. Sybase epbdb1d.ny.ssmb.com:4100. PBOnline. epblnx50d. epblnx51d. AHCluster – 3GB. ENTCluster – 3GB. GPFCluster – 4GB. CSLCluster – 3GB. REFCluster – 3GB. SQL Server eqpfsqtpdv01.nam.nsroot.net:2431. gpfNode7. gpfNode9. gpfNode5. gpfNode3. gpfNode1. gpfNode10. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: GPF Dev Weblogic Domain Structure
Page 2: GPF Dev Weblogic Domain Structure

GPF Dev Weblogic Domain Structure

epblnx50d

AHCluster – 3GBAHCluster – 3GB

gpfNode7 gpfNode8

ENTCluster – 3GBENTCluster – 3GB

gpfNode9 gpfNode10

CSLCluster – 3GBCSLCluster – 3GB

gpfNode5 gpfNode6

REFCluster – 3GBREFCluster – 3GB

gpfNode3 gpfNode4

GPFCluster – 4GBGPFCluster – 4GB

gpfNode1 gpfNode2

Admin ServerAdmin Server

SQL Server eqpfsqtpdv01.nam.nsroot.net:2431SQL Server eqpfsqtpdv01.nam.nsroot.net:2431

AccountsData SubLedger InstrumentRefData MarketData

Sybase epbdb1d.ny.ssmb.com:4100Sybase epbdb1d.ny.ssmb.com:4100

PBOnline

Container-Level Data SourcesAHDatasourceSubLedgerFinderXADataSourceSubLedgerXADatasourceReferenceDatasourceMarketDatasourceProductProcessorDS

epblnx51d

11 Processes needed for whole deployement.

Page 3: GPF Dev Weblogic Domain Structure

AHFinderServiceImpl AHFinderProxyImpAHDAOManager

AHCacheAspect

PfclientAcctDAO

PffundAcctDAO

PfsubAcctDAO

PfgroupAcctDAO

PfrefCodesAcctDAO

…. 45 in total

Database

Save()Delete()Merge()attachClean()attachDirty()findById()……

Core Business Logic and Data Access Classes

AHManagerServiceImpl AHManagerProxyImpl

clientAcctRegion fundAcctRegion

subAcctRegion groupAcctRegion

Page 4: GPF Dev Weblogic Domain Structure

ESF (Enterprise Service Framework) Stack

Container4.0.jar

Esf_config.xml

GPFServices.jar

GPFServices Application

Mule1.4.1.jar

Container4.0.jar

Esf_config.xml

AHGui.jar

AHGui Application

Mule1.4.1.jar

Axis:Servlet Axis:JMS

Page 5: GPF Dev Weblogic Domain Structure

Data Bus Data Bus Data Bus

AHGUI

AHFinderServiceFacade.execWSMethod()

ESFClient.send()

AH_esf_config_client.xmlESFAxisConnector

AH DB

GPFServices

EMS Server

Page 6: GPF Dev Weblogic Domain Structure

Common Accounts GettersPfAccount getCSLSubAccount() PfAccount[] getPfClientAccountsByAcronym() PfAccount[] getPfFundAccountsByAcronym() PfAccount[] getPfSubAccountsByProductProcessor() ...... 33 in totalPfgroup getPfGroupByPfGrpId() ...... 6 in total

Abstract entities based only on cached dataPfAccount getAccountHierarchyByPfId() ClientSummary[] getAllClientSummary() FundSummary[] getAllFundSummary() GroupSummary[] getAllGroupSummary() SubAcctSummary[] getAllSubAcctSummary()

Data not cached by GemfirePfacctAddress getPfacctAddress() PfacctAddress[] getPfacctAddresses() PfrefCodes[] getAllPfrefCodes() Pfexception[] getPfexceptions()

True if specified entity exist in cache or DBBoolean isValidClientAcct() Boolean isValidFundAcct() Boolean isValidSubAcct() Boolean isValidSubAcctById() Boolean isValidSubAcctByRootIdAndPortfolioId()

Clear caches and Reload From Databasevoid refreshCache()

Hibernate Save, children entities will also be saved. E.g. SubAcctEQRefPfAccount updateClientAccount(PfclientAcct clientAccount)PfAccount updateFundAccount(PffundAcct fundAccount)PfAccount updateSubAccount(PfsubAcct subAccounts)

Hibernate Save, children entities will NOT be saved, e.g. childrenAccountsPfAccount updateAccount(PfAccount account)Pfgroup addGroup(Pfgroup pfgroup) Pfgroup updateGroup(Pfgroup pfgroup) Integer deleteGroup(Integer pfGrpId, Integer version)

Changing Hierarchy Structure, ActionXXX stored procedures HandledPfAccount addClientAccount(AddClient addClient)Integer deleteClientAccount(DeleteClient deleteClient) PfAccount mergeClientAccount(MergeClient mergeClient) PfAccount addFundAccount(AddFund addFund)Integer deleteFundAccount(DeleteFund deleteFund) PfAccount mergeFundAccount(MergeFund mergeFund) PfAccount addSubAccount(AddSubAcct addSubAccount)Integer deleteSubAccount(DeleteSubAcct deleteSubAccount) PfAccount updateParentAccount(UpdateParent updateParent)

Convert CITI data to PF data, UpdDDIXXX stored procedures handledPfAccount[] setPFFundAcctFromDDI(Integer citiId) PfAccount[] setPFSubAcctFromDDI(Integer citiId)

Finder Service Functions

Manager Service Functions

Page 7: GPF Dev Weblogic Domain Structure

Cache Handling – CacheAspect

Aspects Defined in AHServiceContext.xml<aop:around method="getAccountsFromCache" pointcut="execution(* .AHFinderService.getPf*Accounts*(..))" /><aop:around method="getAccountFromCache" pointcut="execution(* .AHFinderService.getPf*AccountBy*(..))" /><aop:around method="getAccountFromCache" pointcut="execution(* .AHFinderService.getCSLSubAccount(..))" /><aop:around method="getGroupsFromCache" pointcut="execution(* .AHFinderService.getPf*Groups*(..))" /><aop:around method="getGroupFromCache" pointcut="execution(* .AHFinderService.getPfGroupBy*(..))" /><aop:around method="isValid" pointcut="execution(* .AHFinderService.isValid*(..))" /> <aop:around method="getAccountHierarchyByPfId" pointcut="execution(* .AHFinderService.getAccountHierarchyByPfId(..))" /><aop:around method="getAllClientSummary" pointcut="execution(* .AHFinderService.getAllClientSummary(..))" /><aop:around method="getAllFundSummary" pointcut="execution(* .AHFinderService.getAllFundSummary(..))" /><aop:after-returning method="putInCache" pointcut="execution(* AHManagerService.add*Account(..))" /><aop:after-returning method="putInCache" pointcut="execution(* AHManagerService.update*Account(..))" /><aop:after-returning method="putPfAccountsInCache" pointcut="execution(* AHManagerService.set*(..))" /><aop:after-returning method="putInCache" pointcut="execution(* AHManagerService.merge*Account(..))" /><aop:after-returning method="removeFromCache" pointcut="execution(* AHManagerService.delete*Account(..))" /><aop:after-returning method="removeGroupFromCache" pointcut="execution(* AHManagerService.deleteGroup(..))" /><aop:after-returning method="putGroupInCache" pointcut="execution(* AHManagerService.addGroup(..))" />

Spring Advice TypesBefore advice: Executes before a method enters execution.After returning advice: Executed after a method completes normally.After throwing advice: Executed if a method exits by throwing an exception.After (finally) advice: Executed regardless of the means by which a method exits.Around advice: Perform custom behavior before and after the method invocation.

ObjectiveWhen reading data, use cache instead of databaseWhen writing data, update cache as necessary

Page 8: GPF Dev Weblogic Domain Structure

public PfAccount getPfClientAcctByAcronymFromCache(ProceedingJoinPoint joinPoint) { try {

Object[] args = joinPoint.getArgs();PfAccount pfAccount = null;

String queryString = "SELECT * FROM /root/ClientAccount r " + "WHERE r.pfclientAcct.pfClientAcronym = “ + "'" + args[0] + "'";

Query query = cacheManager.getQueryService().newQuery(queryString);SelectResults results = (SelectResults) query.execute();Iterator iter = sr.iterator();if (iter.hasNext()) {

pfAccount = (PfAccount) iter.next();}

}

if (null == pfAccount) { pfAccount = (PfAccount) joinPoint.proceed();if (pfAccount != null) {

Region region = cacheManager.getRegion("root/ClientAccount");

region.put(pfAccount.getPfId(), pfAccount);

AhEventPublisher ahEventPublisher = new AhEventPublisher();

ahEventPublisher.publish(pfAccount);ahEventPublisher.close();

}} else {

pfAccount.setPfChildAccounts(new PfAccount[0]);pfAccount.setPfIndirectChildAccounts(new PfAccount[0]);

}

return pfAccount; } catch (Throwable t) {

AHExceptionUtil.throwAHException(t); }}

Sample Read Data From Cache

Gemfire query to find data, similar to Hibernate

Publish cached data changes to

JMS queue

If no data found in cache,proceed to AHFinderService to

try getting it from database

Nullify children references toShrink the size of return object

Page 9: GPF Dev Weblogic Domain Structure

Mule Data Flow

Supported TransportsAxisBPM CXF EJBEmailFileFTP HTTPHTTPSIMAPJDBC Jetty JMS Multicast POP3RMI ServletSMTPSOAP STDIOTCP UDP VMWebSphere MQ XMPP

Page 10: GPF Dev Weblogic Domain Structure

Challenges

PfAccount

PfClientAccount PfFundAccount PfSubAccount

PfAccount

SSL HandShaking Exception (certificate file)NoSuchElementException vo object unmatched)Update function doesnot return updated result

PfGroupAHGUI Data & Function

Page 11: GPF Dev Weblogic Domain Structure

ESF Service Config Elements

ConnectorsEsf : JmsConnectorEsf : AxisConnectorMule : VMConnector

Interceptor-StackEsf : LoggingInterceptorEsf : TimerInterceptor

Esf_config_deploy.xml

Transformersmule : ObjectToXMLmule : JMSMessageToObjectmule : ObjectToJMSMessageMule : ByteArrayToSerializableAh : AHTransformer

ServicesAh : AHFinderService inbound : axis:servlet://AHFinderService inbound : axis:jms://gpf_159122.AHFinderService.requestAh : AHManagerService inbound : axis:servlet://AHManagerService inbound : axis:jms://gpf_159122.AHManagerService.requestMule : BridgeComponent inbound : vm://ahJmsProxy outbound : axis:jms://gpf_159122.Equity.AHNotificationReceiver.request?method=receiveAHEvent outbound : axis:jms://gpf_159122.IPB.AHNotificationReceiver.request?method=receiveAHEvent

Exception StrategyAHDefaultConnectorExceptionStrategy Profiles

Threading ProfilePooling ProfileQueue Profile

Page 12: GPF Dev Weblogic Domain Structure

ESF Service Config Structure<esf-environment-properties> <threading-profile /> <pooling-profile /> <queue-profile /></esf-environment-properties><container-context className="org.mule.extras.spring.SpringContainerContext" />

<connector className="com.citi.cibtech.esf.providers.jms.JmsConnector" name="jmsQueueConnector"> <exception-strategy className="com.citi.gpf.ah.utils.AHDefaultConnectorExceptionStrategy" /></connector><connector className="com.citi.cibtech.esf.ESFAxisConnector" name="axisConnector" /><connector name="vmConnector“ className="org.mule.providers.vm.VMConnector" />

<transformers> <transformer name="ObjectToXml" className="org.mule.transformers.xml.ObjectToXml“ returnClass="java.lang.String" /> <transformer name="AHTransformer“ className="com.citi.gpf.ah.utils.AHJmsTransformer" returnClass="java.lang.Object" /></transformers>

<interceptor-stack name="ahIntercept"> <interceptor className="com.citi.cibtech.esf.interceptors.LoggingInterceptor" /> <interceptor className="com.citi.cibtech.esf.interceptors.TimerInterceptor" /></interceptor-stack>

<model name="AHModel"> <esf-descriptor implementation="ahFinderService" name="AHFinderService"> <inbound-router>

<endpoint address="axis:servlet://AHFinderService" /><endpoint address="axis:jms://citi.eqpb.ny.pbapps.gpf_159122.AHFinderService.request" />

</inbound-router> <interceptor name="ahIntercept" /> <properties>

<map name="axisOptions"> <property name="allowedMethods"

value="getVersionResult,getPfClientAccounts,getPfFundAccounts,getPfSubAccounts,,getAllSubAcctSummary..." /></map></properties>

</esf-descriptor></model>

Page 13: GPF Dev Weblogic Domain Structure

AHService Config Files Overview

Page 14: GPF Dev Weblogic Domain Structure

Utility Classes

UIDGenerator – A 24 character-length unique string generator, based on System.currentTimeMillis(), host IP address, and java.security.SecureRandom(“SHA1PRN”). It’s used by AHEventPublished to assign event id. Also used by AhJmsTopicMsgPublisher to set service call id.AHSizeAgent – Make rough calculation of memory consumption size for those stored in cache. Was used by AHCacheAspect getAccountsFromCache(), getAccountHierarchyByID(). Not in use right now.AHContextListener – Registered in web.xml as a listener class. Upon context initilization being finished, it calls AHStartupLoader to load data from database into cach. It also pass the ESF config file to ESFXMLConfigurationBuilder to initilize the ESF framework components.AHDefaultConnectorExceptionStrategy – An extension class to org.mule.impl.DefaultExceptionStrategy, in its defaultHandler(Throwable t) method, it simply output the error message via Log4J, its declared as the exception strategy for JMS connection in esf_config_deploy.xmlAHEventPublisher – It’s frequently used AHCacheAspect during most cache data change situations. The method publish(Serializable) convert a cached object (e.g. PfClientAcct) into AHEvent object. The AHEvent object is then dispatched through ESFClient to “vm://ahJmsProxy”. A BridgeComponent declared in esf_config_deploy.xml then resend it to

citi.eqpb.ny.pbapps.gpf_159122.Equity.AHNotificationReceiver via Axis JMS channel

Page 15: GPF Dev Weblogic Domain Structure

The Others

PerformanceMost functions running 2-3 times longer than typical hibernate implementation If service guanrentees that data consistency between Gemfire cache and database why should we get the data from service?

Function FlexibilityWhat if we only want part of the result object?What if we need complex searching logic?

Data IntegrityDoes the service always know what’s been changed?Are the interfaces thread safe?

Maintain EffortWhy so many files need to be changed when we only want to add a single attribute to vo object?Be able to run it in local, for easier coding and debug.