Posts

Showing posts from November, 2014

Supported properties in hook by liferay

In Liferay we know that we can override some of the properties using hooks. To remember all those supported properties is quite difficult. Also how can we know  whether that particular properties  is supported or not ? So we have class called  HookHotDeployListener class to check the supported properties. Look into the  SUPPORTED_PROPERTIES string array variable where it listed all the supported properties. This is how it is listed public class HookHotDeployListener extends BaseHotDeployListener implements PropsKeys { public static final String[] SUPPORTED_PROPERTIES = { "admin.default.group.names", "admin.default.role.names", "admin.default.user.group.names", "asset.publisher.asset.entry.query.processors", "asset.publisher.display.styles", "asset.publisher.query.form.configuration", "auth.forward.by.last.path", "auth.public.paths", "auth.verifier.pipeline", "auto.deploy.liste

How liferay is identifying the database configuration

In liferay we configure the database configuration properties in the portal-ext.properties. So when we restart the server or during server startup , we can see the log as  Determine dialect for MYSQL5 or if it is orcale  Determine dialect for oracle 11g . so how liferay is identifying? In Liferay have a look in to the  DialectDetector class and the method  getDialect(DataSource dataSource) . Look into the following code in the method. Connection connection = dataSource.getConnection(); DatabaseMetaData databaseMetaData = connection.getMetaData(); String dbName = databaseMetaData.getDatabaseProductName(); int dbMajorVersion = databaseMetaData.getDatabaseMajorVersion(); dialectKey = dbName.concat(StringPool.COLON).concat( String.valueOf(dbMajorVersion)); dialect = _dialects.get(dialectKey); if (_log.isInfoEnabled()) { _log.info("Determine dialect for " + dbName + " " + dbMajorVersion); } else if (dbName.startsWith("Oracle") &&

Generating the thread dumps

Image
Liferay has feature to generate thread dumps if request takes more than 5 minutes. So that we can anayalze which thread it taking more time. Search and look into these following properties in the portal.propeties.      #     # The thread dump filter will automatically log thread dumps when the portal     # is too slow. Behavior can be configured via the property     # "thread.dump.speed.threshold".     #     com.liferay.portal.servlet.filters.threaddump.ThreadDumpFilter=true     #     # The thread dump filter will log a thread dump if the portal takes longer     # than the specified number of seconds to process. The thread dump filter     # must be enabled via the property     # "com.liferay.portal.servlet.filters.threaddump.ThreadDumpFilter".     #     thread.dump.speed.threshold=5 Also we have another option to generate the thread DUMP in the control panel , as follow the screenshots