// create handle that comtains lock for use in scheduling and filter callbacks
EPStatementAgentInstanceHandle agentInstanceHandle = new EPStatementAgentInstanceHandle(statementContext.getEpStatementHandle(), agentInstanceLock, agentInstanceId, filterVersion);
// create agent instance context
AgentInstanceScriptContext agentInstanceScriptContext = null;
if (statementContext.getDefaultAgentInstanceScriptContext() != null) {
agentInstanceScriptContext = new AgentInstanceScriptContext();
}
AgentInstanceContext agentInstanceContext = new AgentInstanceContext(statementContext, agentInstanceHandle, agentInstanceId, agentInstanceFilterProxy, agentInstanceProperties, agentInstanceScriptContext);
StatementAgentInstanceLock statementAgentInstanceLock = agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock();
if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().qContextPartitionAllocate(agentInstanceContext);}