Search in sources :

Example 1 with PropertyAccess

use of jp.ossc.nimbus.beans.PropertyAccess in project nimbus by nimbus-org.

the class HttpServletRequestTransferInterceptorService method createService.

/**
 * サービスの生成処理を行う。
 * <p>
 *
 * @exception Exception サービスの生成に失敗した場合
 */
public void createService() throws Exception {
    propertyAccess = new PropertyAccess();
    propertyAccess.setIgnoreNullProperty(true);
}
Also used : PropertyAccess(jp.ossc.nimbus.beans.PropertyAccess)

Example 2 with PropertyAccess

use of jp.ossc.nimbus.beans.PropertyAccess in project nimbus by nimbus-org.

the class TraceLoggingInterceptorService method startService.

public void startService() throws Exception {
    if ((outputParameterProperties != null && outputParameterProperties.length != 0) || (outputReturnProperties != null && outputReturnProperties.length != 0) || (outputTargetProperties != null && outputTargetProperties.length != 0)) {
        propertyAccess = new PropertyAccess();
        propertyAccess.setIgnoreNullProperty(true);
    }
    if (sequenceServiceName != null) {
        sequence = (Sequence) ServiceManagerFactory.getServiceObject(sequenceServiceName);
    }
}
Also used : PropertyAccess(jp.ossc.nimbus.beans.PropertyAccess)

Example 3 with PropertyAccess

use of jp.ossc.nimbus.beans.PropertyAccess in project nimbus by nimbus-org.

the class MBeanWatcherService method createService.

public void createService() throws Exception {
    contextMap = Collections.synchronizedMap(new HashMap());
    propertyAccess = new PropertyAccess();
    propertyAccess.setIgnoreNullProperty(true);
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) PropertyAccess(jp.ossc.nimbus.beans.PropertyAccess)

Example 4 with PropertyAccess

use of jp.ossc.nimbus.beans.PropertyAccess in project nimbus by nimbus-org.

the class DefaultPersistentManagerService method startService.

public void startService() throws Exception {
    propertyAccess = new PropertyAccess();
    propertyAccess.setIgnoreNullProperty(isIgnoreNullProperty);
}
Also used : PropertyAccess(jp.ossc.nimbus.beans.PropertyAccess)

Example 5 with PropertyAccess

use of jp.ossc.nimbus.beans.PropertyAccess in project nimbus by nimbus-org.

the class DatabaseSharedContextKeyDistributorService method startService.

public void startService() throws Exception {
    if (connectionFactoryServiceName != null) {
        connectionFactory = (ConnectionFactory) ServiceManagerFactory.getServiceObject(connectionFactoryServiceName);
    }
    if (connectionFactory == null) {
        throw new IllegalArgumentException("ConnectionFactory is null.");
    }
    if (persistentManagerServiceName != null) {
        persistentManager = (PersistentManager) ServiceManagerFactory.getServiceObject(persistentManagerServiceName);
    }
    if (persistentManager == null) {
        throw new IllegalArgumentException("PersistentManager is null.");
    }
    Connection con = null;
    try {
        con = connectionFactory.getConnection();
        List keyList = null;
        if (databaseRecord == null) {
            if (keyClass == null) {
                keyList = new RecordList();
            }
        } else {
            keyList = new RecordList(null, databaseRecord.getRecordSchema());
        }
        Object[] keys = null;
        if (keyList == null) {
            keys = (Object[]) persistentManager.loadQuery(con, keySelectQuery, null, Array.newInstance(keyClass, 0).getClass());
        } else {
            persistentManager.loadQuery(con, keySelectQuery, null, keyList);
            keys = keyList.toArray();
        }
        if (keys == null || keys.length == 0) {
            throw new IllegalArgumentException("Not found key record. keySelectQuery=" + keySelectQuery);
        }
        Map tmpKeyIndexMap = new HashMap();
        if (keyList == null) {
            for (int i = 0; i < keys.length; i++) {
                tmpKeyIndexMap.put(keys[i], new Integer(i));
            }
        } else {
            PropertyAccess propertyAccess = new PropertyAccess();
            for (int i = 0; i < keys.length; i++) {
                Object key = null;
                if (keyClass == null) {
                    key = propertyAccess.get(keys[i], keyPropertyName);
                } else {
                    key = keyClass.newInstance();
                    for (Iterator itr = keyPropertyMappings.entrySet().iterator(); itr.hasNext(); ) {
                        Map.Entry propMapping = (Map.Entry) itr.next();
                        propertyAccess.set(key, (String) propMapping.getValue(), propertyAccess.get(keys[i], (String) propMapping.getKey()));
                    }
                }
                tmpKeyIndexMap.put(key, new Integer(i));
            }
        }
        keyIndexMap = tmpKeyIndexMap;
    } finally {
        if (con != null) {
            try {
                con.close();
            } catch (SQLException e) {
            }
        }
    }
}
Also used : HashMap(java.util.HashMap) SQLException(java.sql.SQLException) Connection(java.sql.Connection) PropertyAccess(jp.ossc.nimbus.beans.PropertyAccess) RecordList(jp.ossc.nimbus.beans.dataset.RecordList) Iterator(java.util.Iterator) RecordList(jp.ossc.nimbus.beans.dataset.RecordList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

PropertyAccess (jp.ossc.nimbus.beans.PropertyAccess)9 HashMap (java.util.HashMap)2 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 RecordList (jp.ossc.nimbus.beans.dataset.RecordList)1