mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merge 1.4 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4340 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4350 . svn resolved root\projects\3rd-party\.classpath svn resolved root\projects\repository\source\java\org\alfresco\repo\workflow\WorkflowInterpreter.java svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4379 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4380 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4420 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4421 . svn resolved root\projects\3rd-party\.classpath git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4655 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -57,7 +57,6 @@ public class OpenOfficeMetadataExtracter extends AbstractMetadataExtracter
|
||||
};
|
||||
|
||||
private OpenOfficeConnection connection;
|
||||
private boolean isConnected;
|
||||
|
||||
public OpenOfficeMetadataExtracter()
|
||||
{
|
||||
@@ -69,6 +68,25 @@ public class OpenOfficeMetadataExtracter extends AbstractMetadataExtracter
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
private synchronized void connect()
|
||||
{
|
||||
if (isConnected())
|
||||
{
|
||||
// just leave it
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.connect();
|
||||
}
|
||||
catch (ConnectException e)
|
||||
{
|
||||
logger.warn(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialises the bean by establishing an UNO connection
|
||||
*/
|
||||
@@ -76,18 +94,14 @@ public class OpenOfficeMetadataExtracter extends AbstractMetadataExtracter
|
||||
{
|
||||
PropertyCheck.mandatory("OpenOfficeMetadataExtracter", "connection", connection);
|
||||
|
||||
// attempt to make an connection
|
||||
try
|
||||
// attempt a connection
|
||||
connect();
|
||||
if (isConnected())
|
||||
{
|
||||
connection.connect();
|
||||
isConnected = true;
|
||||
// register
|
||||
// Only register if the connection is available initially. Reconnections are only supported
|
||||
// if the server is able to connection initially.
|
||||
super.register();
|
||||
}
|
||||
catch (ConnectException e)
|
||||
{
|
||||
isConnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +110,7 @@ public class OpenOfficeMetadataExtracter extends AbstractMetadataExtracter
|
||||
*/
|
||||
public boolean isConnected()
|
||||
{
|
||||
return isConnected;
|
||||
return connection.isConnected();
|
||||
}
|
||||
|
||||
public void extractInternal(ContentReader reader, final Map<QName, Serializable> destination) throws Throwable
|
||||
|
Reference in New Issue
Block a user